mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-22 23:45:02 +00:00
Removed client-ionic
This commit is contained in:
parent
762fa850f1
commit
0df64d5e7d
@ -1,12 +0,0 @@
|
|||||||
import { CapacitorConfig } from '@capacitor/cli';
|
|
||||||
|
|
||||||
const config: CapacitorConfig = {
|
|
||||||
appId: 'com.stirlingtools.pdf',
|
|
||||||
appName: 'StirlingPDF',
|
|
||||||
webDir: 'dist',
|
|
||||||
server: {
|
|
||||||
androidScheme: 'https'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
@ -1,10 +0,0 @@
|
|||||||
import { defineConfig } from "cypress";
|
|
||||||
|
|
||||||
export default defineConfig({
|
|
||||||
e2e: {
|
|
||||||
baseUrl: "http://localhost:5173",
|
|
||||||
setupNodeEvents(on, config) {
|
|
||||||
// implement node event listeners here
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
@ -1,6 +0,0 @@
|
|||||||
describe('My First Test', () => {
|
|
||||||
it('Visits the app root url', () => {
|
|
||||||
cy.visit('/')
|
|
||||||
cy.contains('#container', 'Ready to create an app?')
|
|
||||||
})
|
|
||||||
})
|
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "Using fixtures to represent data",
|
|
||||||
"email": "hello@cypress.io",
|
|
||||||
"body": "Fixtures are a great way to mock data for responses to routes"
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
/// <reference types="cypress" />
|
|
||||||
// ***********************************************
|
|
||||||
// This example commands.ts shows you how to
|
|
||||||
// create various custom commands and overwrite
|
|
||||||
// existing commands.
|
|
||||||
//
|
|
||||||
// For more comprehensive examples of custom
|
|
||||||
// commands please read more here:
|
|
||||||
// https://on.cypress.io/custom-commands
|
|
||||||
// ***********************************************
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// -- This is a parent command --
|
|
||||||
// Cypress.Commands.add('login', (email, password) => { ... })
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// -- This is a child command --
|
|
||||||
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// -- This is a dual command --
|
|
||||||
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// -- This will overwrite an existing command --
|
|
||||||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
|
||||||
//
|
|
||||||
// declare global {
|
|
||||||
// namespace Cypress {
|
|
||||||
// interface Chainable {
|
|
||||||
// login(email: string, password: string): Chainable<void>
|
|
||||||
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
|
|
||||||
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
|
|
||||||
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
@ -1,20 +0,0 @@
|
|||||||
// ***********************************************************
|
|
||||||
// This example support/e2e.ts is processed and
|
|
||||||
// loaded automatically before your test files.
|
|
||||||
//
|
|
||||||
// This is a great place to put global configuration and
|
|
||||||
// behavior that modifies Cypress.
|
|
||||||
//
|
|
||||||
// You can change the location of this file or turn off
|
|
||||||
// automatically serving support files with the
|
|
||||||
// 'supportFile' configuration option.
|
|
||||||
//
|
|
||||||
// You can read more here:
|
|
||||||
// https://on.cypress.io/configuration
|
|
||||||
// ***********************************************************
|
|
||||||
|
|
||||||
// Import commands.js using ES2015 syntax:
|
|
||||||
import './commands'
|
|
||||||
|
|
||||||
// Alternatively you can use CommonJS syntax:
|
|
||||||
// require('./commands')
|
|
@ -1,33 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<title>Ionic App</title>
|
|
||||||
|
|
||||||
<base href="/" />
|
|
||||||
|
|
||||||
<meta name="color-scheme" content="light dark" />
|
|
||||||
<meta
|
|
||||||
name="viewport"
|
|
||||||
content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
|
|
||||||
/>
|
|
||||||
<meta name="format-detection" content="telephone=no" />
|
|
||||||
<meta name="msapplication-tap-highlight" content="no" />
|
|
||||||
|
|
||||||
<link rel="manifest" href="/manifest.json" />
|
|
||||||
|
|
||||||
<link rel="shortcut icon" type="image/png" href="/favicon.png" />
|
|
||||||
|
|
||||||
<!-- add to homescreen for ios -->
|
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
||||||
<meta name="apple-mobile-web-app-title" content="Ionic App" />
|
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
|
||||||
|
|
||||||
<!-- TODO: I have no idea if this will build: -->
|
|
||||||
<script src="/src/utils/browserfs.min.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="root"></div>
|
|
||||||
<script type="module" src="/src/main.tsx"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "StirlingPDF",
|
|
||||||
"integrations": {
|
|
||||||
"capacitor": {}
|
|
||||||
},
|
|
||||||
"type": "react-vite"
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "Blank Starter",
|
|
||||||
"baseref": "main",
|
|
||||||
"tarignore": [
|
|
||||||
"node_modules",
|
|
||||||
"package-lock.json",
|
|
||||||
"www"
|
|
||||||
],
|
|
||||||
"scripts": {
|
|
||||||
"test": "npm run build && npm run test.unit -- --watch=false && npm i --no-save concurrently && ./node_modules/.bin/concurrently \"npm run dev\" \"npm run test.e2e\" --kill-others --success first"
|
|
||||||
}
|
|
||||||
}
|
|
6316
client-ionic/package-lock.json
generated
6316
client-ionic/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,58 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@stirling-pdf/client-ionic",
|
|
||||||
"private": true,
|
|
||||||
"version": "0.0.0",
|
|
||||||
"type": "module",
|
|
||||||
"scripts": {
|
|
||||||
"dev": "ionic serve",
|
|
||||||
"dev-android": "ionic build && ionic cap run android -l --external --open",
|
|
||||||
"linux_build-release-android": "ionic cap build android --no-open --prod && cd android && ./gradlew assembleDebug && mkdir -p ../releases && mv app/build/outputs/apk/debug/app-debug.apk ../releases/StirlingPDF.apk && echo \"Done packaging APK!!!\"",
|
|
||||||
"linux_build-release-pwa": "ionic build && mkdir -p releases && zip -r releases/pwa.zip dist/ && echo \"Done packaging PWA!!!\"",
|
|
||||||
"build-vite": "tsc && vite build",
|
|
||||||
"preview": "vite preview",
|
|
||||||
"test.e2e": "cypress run",
|
|
||||||
"test.unit": "vitest",
|
|
||||||
"lint": "eslint"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@capacitor/android": "5.5.1",
|
|
||||||
"@capacitor/app": "5.0.6",
|
|
||||||
"@capacitor/core": "5.5.1",
|
|
||||||
"@capacitor/haptics": "5.0.6",
|
|
||||||
"@capacitor/ios": "^5.5.1",
|
|
||||||
"@capacitor/keyboard": "5.0.6",
|
|
||||||
"@capacitor/status-bar": "5.0.6",
|
|
||||||
"@capawesome/capacitor-file-picker": "^5.1.1",
|
|
||||||
"@ionic/react": "^7.0.0",
|
|
||||||
"@ionic/react-router": "^7.0.0",
|
|
||||||
"@stirling-pdf/shared-operations": "*",
|
|
||||||
"@types/react-router": "^5.1.20",
|
|
||||||
"@types/react-router-dom": "^5.3.3",
|
|
||||||
"downloadjs": "^1.4.7",
|
|
||||||
"ionicons": "^7.0.0",
|
|
||||||
"pdf-lib": "^1.17.1",
|
|
||||||
"react": "^18.2.0",
|
|
||||||
"react-dom": "^18.2.0",
|
|
||||||
"react-router": "^5.3.4",
|
|
||||||
"react-router-dom": "^5.3.4"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@capacitor/cli": "5.5.1",
|
|
||||||
"@testing-library/jest-dom": "^5.16.5",
|
|
||||||
"@testing-library/react": "^14.0.0",
|
|
||||||
"@testing-library/user-event": "^14.4.3",
|
|
||||||
"@types/downloadjs": "^1.4.5",
|
|
||||||
"@types/react": "^18.0.27",
|
|
||||||
"@types/react-dom": "^18.0.10",
|
|
||||||
"@vitejs/plugin-legacy": "^4.0.2",
|
|
||||||
"@vitejs/plugin-react": "^4.0.1",
|
|
||||||
"cypress": "^13.3.2",
|
|
||||||
"eslint": "^8.35.0",
|
|
||||||
"eslint-plugin-react": "^7.32.2",
|
|
||||||
"jsdom": "^22.1.0",
|
|
||||||
"typescript": "^5.1.6",
|
|
||||||
"vite": "4.5.0",
|
|
||||||
"vite-plugin-pwa": "^0.16.6",
|
|
||||||
"vitest": "^0.32.2"
|
|
||||||
}
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 930 B |
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"short_name": "StirlingPDF",
|
|
||||||
"name": "StirlingPDF",
|
|
||||||
"icons": [
|
|
||||||
{
|
|
||||||
"src": "assets/icon/favicon.png",
|
|
||||||
"sizes": "64x64 32x32 24x24 16x16",
|
|
||||||
"type": "image/x-icon"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "assets/icon/icon.png",
|
|
||||||
"type": "image/png",
|
|
||||||
"sizes": "512x512",
|
|
||||||
"purpose": "maskable"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"start_url": ".",
|
|
||||||
"display": "standalone",
|
|
||||||
"theme_color": "#ffffff",
|
|
||||||
"background_color": "#ffffff"
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import { render } from '@testing-library/react';
|
|
||||||
import App from './App';
|
|
||||||
|
|
||||||
test('renders without crashing', () => {
|
|
||||||
const { baseElement } = render(<App />);
|
|
||||||
expect(baseElement).toBeDefined();
|
|
||||||
});
|
|
@ -1,42 +0,0 @@
|
|||||||
import { Redirect, Route } from 'react-router-dom';
|
|
||||||
import { IonApp, IonRouterOutlet, setupIonicReact } from '@ionic/react';
|
|
||||||
import { IonReactRouter } from '@ionic/react-router';
|
|
||||||
import Home from './pages/Home';
|
|
||||||
|
|
||||||
/* Core CSS required for Ionic components to work properly */
|
|
||||||
import '@ionic/react/css/core.css';
|
|
||||||
|
|
||||||
/* Basic CSS for apps built with Ionic */
|
|
||||||
import '@ionic/react/css/normalize.css';
|
|
||||||
import '@ionic/react/css/structure.css';
|
|
||||||
import '@ionic/react/css/typography.css';
|
|
||||||
|
|
||||||
/* Optional CSS utils that can be commented out */
|
|
||||||
import '@ionic/react/css/padding.css';
|
|
||||||
import '@ionic/react/css/float-elements.css';
|
|
||||||
import '@ionic/react/css/text-alignment.css';
|
|
||||||
import '@ionic/react/css/text-transformation.css';
|
|
||||||
import '@ionic/react/css/flex-utils.css';
|
|
||||||
import '@ionic/react/css/display.css';
|
|
||||||
|
|
||||||
/* Theme variables */
|
|
||||||
import './theme/variables.css';
|
|
||||||
|
|
||||||
setupIonicReact();
|
|
||||||
|
|
||||||
const App: React.FC = () => (
|
|
||||||
<IonApp>
|
|
||||||
<IonReactRouter>
|
|
||||||
<IonRouterOutlet>
|
|
||||||
<Route exact path="/home">
|
|
||||||
<Home />
|
|
||||||
</Route>
|
|
||||||
<Route exact path="/">
|
|
||||||
<Redirect to="/home" />
|
|
||||||
</Route>
|
|
||||||
</IonRouterOutlet>
|
|
||||||
</IonReactRouter>
|
|
||||||
</IonApp>
|
|
||||||
);
|
|
||||||
|
|
||||||
export default App;
|
|
@ -1,24 +0,0 @@
|
|||||||
#container {
|
|
||||||
text-align: center;
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
}
|
|
||||||
|
|
||||||
#container strong {
|
|
||||||
font-size: 20px;
|
|
||||||
line-height: 26px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#container p {
|
|
||||||
font-size: 16px;
|
|
||||||
line-height: 22px;
|
|
||||||
color: #8c8c8c;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#container a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
import './ExploreContainer.css';
|
|
||||||
|
|
||||||
interface ContainerProps { }
|
|
||||||
|
|
||||||
const ExploreContainer: React.FC<ContainerProps> = () => {
|
|
||||||
return (
|
|
||||||
<div id="container">
|
|
||||||
<strong>Ready to create an app?</strong>
|
|
||||||
<p>Start with Ionic <a target="_blank" rel="noopener noreferrer" href="https://ionicframework.com/docs/components">UI Components</a></p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ExploreContainer;
|
|
@ -1,11 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import { createRoot } from 'react-dom/client';
|
|
||||||
import App from './App';
|
|
||||||
|
|
||||||
const container = document.getElementById('root');
|
|
||||||
const root = createRoot(container!);
|
|
||||||
root.render(
|
|
||||||
<React.StrictMode>
|
|
||||||
<App />
|
|
||||||
</React.StrictMode>
|
|
||||||
);
|
|
@ -1,48 +0,0 @@
|
|||||||
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar, IonButton } from '@ionic/react';
|
|
||||||
import './Home.css';
|
|
||||||
import { rotatePages } from '../utils/pdf-operations.js';
|
|
||||||
|
|
||||||
import { FilePicker } from '@capawesome/capacitor-file-picker';
|
|
||||||
|
|
||||||
import download from 'downloadjs';
|
|
||||||
|
|
||||||
console.log(rotatePages);
|
|
||||||
async function rotate90() {
|
|
||||||
console.log("Test rotate 90 with Button Click");
|
|
||||||
|
|
||||||
const pickedFiles = await FilePicker.pickFiles({
|
|
||||||
types: ['application/pdf'],
|
|
||||||
multiple: false,
|
|
||||||
});
|
|
||||||
const file = pickedFiles.files[0];
|
|
||||||
|
|
||||||
const buffer = await file.blob?.arrayBuffer();
|
|
||||||
if (!buffer) return;
|
|
||||||
|
|
||||||
const rotated = await rotatePages(buffer, 90)
|
|
||||||
|
|
||||||
download(rotated, "Rotated.pdf", "application/pdf");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Home: React.FC = () => {
|
|
||||||
return (
|
|
||||||
<IonPage>
|
|
||||||
<IonHeader>
|
|
||||||
<IonToolbar>
|
|
||||||
<IonTitle>Blank</IonTitle>
|
|
||||||
</IonToolbar>
|
|
||||||
</IonHeader>
|
|
||||||
<IonContent fullscreen>
|
|
||||||
<IonHeader collapse="condense">
|
|
||||||
<IonToolbar>
|
|
||||||
<IonTitle size="large">Blank</IonTitle>
|
|
||||||
</IonToolbar>
|
|
||||||
</IonHeader>
|
|
||||||
<IonButton onClick={rotate90}>Rotate 90</IonButton>
|
|
||||||
</IonContent>
|
|
||||||
</IonPage>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Home;
|
|
@ -1,14 +0,0 @@
|
|||||||
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
|
||||||
// allows you to do things like:
|
|
||||||
// expect(element).toHaveTextContent(/react/i)
|
|
||||||
// learn more: https://github.com/testing-library/jest-dom
|
|
||||||
import '@testing-library/jest-dom/extend-expect';
|
|
||||||
|
|
||||||
// Mock matchmedia
|
|
||||||
window.matchMedia = window.matchMedia || function() {
|
|
||||||
return {
|
|
||||||
matches: false,
|
|
||||||
addListener: function() {},
|
|
||||||
removeListener: function() {}
|
|
||||||
};
|
|
||||||
};
|
|
@ -1,242 +0,0 @@
|
|||||||
/* Ionic Variables and Theming. For more info, please see:
|
|
||||||
http://ionicframework.com/docs/theming/ */
|
|
||||||
|
|
||||||
/** Ionic CSS Variables **/
|
|
||||||
:root {
|
|
||||||
/** primary **/
|
|
||||||
--ion-color-primary: #3880ff;
|
|
||||||
--ion-color-primary-rgb: 56, 128, 255;
|
|
||||||
--ion-color-primary-contrast: #ffffff;
|
|
||||||
--ion-color-primary-contrast-rgb: 255, 255, 255;
|
|
||||||
--ion-color-primary-shade: #3171e0;
|
|
||||||
--ion-color-primary-tint: #4c8dff;
|
|
||||||
|
|
||||||
/** secondary **/
|
|
||||||
--ion-color-secondary: #3dc2ff;
|
|
||||||
--ion-color-secondary-rgb: 61, 194, 255;
|
|
||||||
--ion-color-secondary-contrast: #ffffff;
|
|
||||||
--ion-color-secondary-contrast-rgb: 255, 255, 255;
|
|
||||||
--ion-color-secondary-shade: #36abe0;
|
|
||||||
--ion-color-secondary-tint: #50c8ff;
|
|
||||||
|
|
||||||
/** tertiary **/
|
|
||||||
--ion-color-tertiary: #5260ff;
|
|
||||||
--ion-color-tertiary-rgb: 82, 96, 255;
|
|
||||||
--ion-color-tertiary-contrast: #ffffff;
|
|
||||||
--ion-color-tertiary-contrast-rgb: 255, 255, 255;
|
|
||||||
--ion-color-tertiary-shade: #4854e0;
|
|
||||||
--ion-color-tertiary-tint: #6370ff;
|
|
||||||
|
|
||||||
/** success **/
|
|
||||||
--ion-color-success: #2dd36f;
|
|
||||||
--ion-color-success-rgb: 45, 211, 111;
|
|
||||||
--ion-color-success-contrast: #ffffff;
|
|
||||||
--ion-color-success-contrast-rgb: 255, 255, 255;
|
|
||||||
--ion-color-success-shade: #28ba62;
|
|
||||||
--ion-color-success-tint: #42d77d;
|
|
||||||
|
|
||||||
/** warning **/
|
|
||||||
--ion-color-warning: #ffc409;
|
|
||||||
--ion-color-warning-rgb: 255, 196, 9;
|
|
||||||
--ion-color-warning-contrast: #000000;
|
|
||||||
--ion-color-warning-contrast-rgb: 0, 0, 0;
|
|
||||||
--ion-color-warning-shade: #e0ac08;
|
|
||||||
--ion-color-warning-tint: #ffca22;
|
|
||||||
|
|
||||||
/** danger **/
|
|
||||||
--ion-color-danger: #eb445a;
|
|
||||||
--ion-color-danger-rgb: 235, 68, 90;
|
|
||||||
--ion-color-danger-contrast: #ffffff;
|
|
||||||
--ion-color-danger-contrast-rgb: 255, 255, 255;
|
|
||||||
--ion-color-danger-shade: #cf3c4f;
|
|
||||||
--ion-color-danger-tint: #ed576b;
|
|
||||||
|
|
||||||
/** dark **/
|
|
||||||
--ion-color-dark: #222428;
|
|
||||||
--ion-color-dark-rgb: 34, 36, 40;
|
|
||||||
--ion-color-dark-contrast: #ffffff;
|
|
||||||
--ion-color-dark-contrast-rgb: 255, 255, 255;
|
|
||||||
--ion-color-dark-shade: #1e2023;
|
|
||||||
--ion-color-dark-tint: #383a3e;
|
|
||||||
|
|
||||||
/** medium **/
|
|
||||||
--ion-color-medium: #92949c;
|
|
||||||
--ion-color-medium-rgb: 146, 148, 156;
|
|
||||||
--ion-color-medium-contrast: #ffffff;
|
|
||||||
--ion-color-medium-contrast-rgb: 255, 255, 255;
|
|
||||||
--ion-color-medium-shade: #808289;
|
|
||||||
--ion-color-medium-tint: #9d9fa6;
|
|
||||||
|
|
||||||
/** light **/
|
|
||||||
--ion-color-light: #f4f5f8;
|
|
||||||
--ion-color-light-rgb: 244, 245, 248;
|
|
||||||
--ion-color-light-contrast: #000000;
|
|
||||||
--ion-color-light-contrast-rgb: 0, 0, 0;
|
|
||||||
--ion-color-light-shade: #d7d8da;
|
|
||||||
--ion-color-light-tint: #f5f6f9;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
/*
|
|
||||||
* Dark Colors
|
|
||||||
* -------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
body {
|
|
||||||
--ion-color-primary: #428cff;
|
|
||||||
--ion-color-primary-rgb: 66,140,255;
|
|
||||||
--ion-color-primary-contrast: #ffffff;
|
|
||||||
--ion-color-primary-contrast-rgb: 255,255,255;
|
|
||||||
--ion-color-primary-shade: #3a7be0;
|
|
||||||
--ion-color-primary-tint: #5598ff;
|
|
||||||
|
|
||||||
--ion-color-secondary: #50c8ff;
|
|
||||||
--ion-color-secondary-rgb: 80,200,255;
|
|
||||||
--ion-color-secondary-contrast: #ffffff;
|
|
||||||
--ion-color-secondary-contrast-rgb: 255,255,255;
|
|
||||||
--ion-color-secondary-shade: #46b0e0;
|
|
||||||
--ion-color-secondary-tint: #62ceff;
|
|
||||||
|
|
||||||
--ion-color-tertiary: #6a64ff;
|
|
||||||
--ion-color-tertiary-rgb: 106,100,255;
|
|
||||||
--ion-color-tertiary-contrast: #ffffff;
|
|
||||||
--ion-color-tertiary-contrast-rgb: 255,255,255;
|
|
||||||
--ion-color-tertiary-shade: #5d58e0;
|
|
||||||
--ion-color-tertiary-tint: #7974ff;
|
|
||||||
|
|
||||||
--ion-color-success: #2fdf75;
|
|
||||||
--ion-color-success-rgb: 47,223,117;
|
|
||||||
--ion-color-success-contrast: #000000;
|
|
||||||
--ion-color-success-contrast-rgb: 0,0,0;
|
|
||||||
--ion-color-success-shade: #29c467;
|
|
||||||
--ion-color-success-tint: #44e283;
|
|
||||||
|
|
||||||
--ion-color-warning: #ffd534;
|
|
||||||
--ion-color-warning-rgb: 255,213,52;
|
|
||||||
--ion-color-warning-contrast: #000000;
|
|
||||||
--ion-color-warning-contrast-rgb: 0,0,0;
|
|
||||||
--ion-color-warning-shade: #e0bb2e;
|
|
||||||
--ion-color-warning-tint: #ffd948;
|
|
||||||
|
|
||||||
--ion-color-danger: #ff4961;
|
|
||||||
--ion-color-danger-rgb: 255,73,97;
|
|
||||||
--ion-color-danger-contrast: #ffffff;
|
|
||||||
--ion-color-danger-contrast-rgb: 255,255,255;
|
|
||||||
--ion-color-danger-shade: #e04055;
|
|
||||||
--ion-color-danger-tint: #ff5b71;
|
|
||||||
|
|
||||||
--ion-color-dark: #f4f5f8;
|
|
||||||
--ion-color-dark-rgb: 244,245,248;
|
|
||||||
--ion-color-dark-contrast: #000000;
|
|
||||||
--ion-color-dark-contrast-rgb: 0,0,0;
|
|
||||||
--ion-color-dark-shade: #d7d8da;
|
|
||||||
--ion-color-dark-tint: #f5f6f9;
|
|
||||||
|
|
||||||
--ion-color-medium: #989aa2;
|
|
||||||
--ion-color-medium-rgb: 152,154,162;
|
|
||||||
--ion-color-medium-contrast: #000000;
|
|
||||||
--ion-color-medium-contrast-rgb: 0,0,0;
|
|
||||||
--ion-color-medium-shade: #86888f;
|
|
||||||
--ion-color-medium-tint: #a2a4ab;
|
|
||||||
|
|
||||||
--ion-color-light: #222428;
|
|
||||||
--ion-color-light-rgb: 34,36,40;
|
|
||||||
--ion-color-light-contrast: #ffffff;
|
|
||||||
--ion-color-light-contrast-rgb: 255,255,255;
|
|
||||||
--ion-color-light-shade: #1e2023;
|
|
||||||
--ion-color-light-tint: #383a3e;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* iOS Dark Theme
|
|
||||||
* -------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
.ios body {
|
|
||||||
--ion-background-color: #000000;
|
|
||||||
--ion-background-color-rgb: 0,0,0;
|
|
||||||
|
|
||||||
--ion-text-color: #ffffff;
|
|
||||||
--ion-text-color-rgb: 255,255,255;
|
|
||||||
|
|
||||||
--ion-color-step-50: #0d0d0d;
|
|
||||||
--ion-color-step-100: #1a1a1a;
|
|
||||||
--ion-color-step-150: #262626;
|
|
||||||
--ion-color-step-200: #333333;
|
|
||||||
--ion-color-step-250: #404040;
|
|
||||||
--ion-color-step-300: #4d4d4d;
|
|
||||||
--ion-color-step-350: #595959;
|
|
||||||
--ion-color-step-400: #666666;
|
|
||||||
--ion-color-step-450: #737373;
|
|
||||||
--ion-color-step-500: #808080;
|
|
||||||
--ion-color-step-550: #8c8c8c;
|
|
||||||
--ion-color-step-600: #999999;
|
|
||||||
--ion-color-step-650: #a6a6a6;
|
|
||||||
--ion-color-step-700: #b3b3b3;
|
|
||||||
--ion-color-step-750: #bfbfbf;
|
|
||||||
--ion-color-step-800: #cccccc;
|
|
||||||
--ion-color-step-850: #d9d9d9;
|
|
||||||
--ion-color-step-900: #e6e6e6;
|
|
||||||
--ion-color-step-950: #f2f2f2;
|
|
||||||
|
|
||||||
--ion-item-background: #000000;
|
|
||||||
|
|
||||||
--ion-card-background: #1c1c1d;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ios ion-modal {
|
|
||||||
--ion-background-color: var(--ion-color-step-100);
|
|
||||||
--ion-toolbar-background: var(--ion-color-step-150);
|
|
||||||
--ion-toolbar-border-color: var(--ion-color-step-250);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Material Design Dark Theme
|
|
||||||
* -------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
.md body {
|
|
||||||
--ion-background-color: #121212;
|
|
||||||
--ion-background-color-rgb: 18,18,18;
|
|
||||||
|
|
||||||
--ion-text-color: #ffffff;
|
|
||||||
--ion-text-color-rgb: 255,255,255;
|
|
||||||
|
|
||||||
--ion-border-color: #222222;
|
|
||||||
|
|
||||||
--ion-color-step-50: #1e1e1e;
|
|
||||||
--ion-color-step-100: #2a2a2a;
|
|
||||||
--ion-color-step-150: #363636;
|
|
||||||
--ion-color-step-200: #414141;
|
|
||||||
--ion-color-step-250: #4d4d4d;
|
|
||||||
--ion-color-step-300: #595959;
|
|
||||||
--ion-color-step-350: #656565;
|
|
||||||
--ion-color-step-400: #717171;
|
|
||||||
--ion-color-step-450: #7d7d7d;
|
|
||||||
--ion-color-step-500: #898989;
|
|
||||||
--ion-color-step-550: #949494;
|
|
||||||
--ion-color-step-600: #a0a0a0;
|
|
||||||
--ion-color-step-650: #acacac;
|
|
||||||
--ion-color-step-700: #b8b8b8;
|
|
||||||
--ion-color-step-750: #c4c4c4;
|
|
||||||
--ion-color-step-800: #d0d0d0;
|
|
||||||
--ion-color-step-850: #dbdbdb;
|
|
||||||
--ion-color-step-900: #e7e7e7;
|
|
||||||
--ion-color-step-950: #f3f3f3;
|
|
||||||
|
|
||||||
--ion-item-background: #1e1e1e;
|
|
||||||
|
|
||||||
--ion-toolbar-background: #1f1f1f;
|
|
||||||
|
|
||||||
--ion-tab-bar-background: #1f1f1f;
|
|
||||||
|
|
||||||
--ion-card-background: #1e1e1e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
html {
|
|
||||||
/* For more information on dynamic font scaling, visit the documentation:
|
|
||||||
https://ionicframework.com/docs/layout/dynamic-font-scaling */
|
|
||||||
--ion-dynamic-font: var(--ion-default-dynamic-font);
|
|
||||||
}
|
|
@ -1,167 +0,0 @@
|
|||||||
//download.js v4.2, by dandavis; 2008-2016. [MIT] see http://danml.com/download.html for tests/usage
|
|
||||||
// v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime
|
|
||||||
// v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for larger+faster saves than dataURLs
|
|
||||||
// v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback was improved with force-download mime and base64 support. 3.1 improved safari handling.
|
|
||||||
// v4 adds AMD/UMD, commonJS, and plain browser support
|
|
||||||
// v4.1 adds url download capability via solo URL argument (same domain/CORS only)
|
|
||||||
// v4.2 adds semantic variable names, long (over 2MB) dataURL support, and hidden by default temp anchors
|
|
||||||
// https://github.com/rndme/download
|
|
||||||
|
|
||||||
(function (root, factory) {
|
|
||||||
if (typeof define === 'function' && define.amd) {
|
|
||||||
// AMD. Register as an anonymous module.
|
|
||||||
define([], factory);
|
|
||||||
} else if (typeof exports === 'object') {
|
|
||||||
// Node. Does not work with strict CommonJS, but
|
|
||||||
// only CommonJS-like environments that support module.exports,
|
|
||||||
// like Node.
|
|
||||||
module.exports = factory();
|
|
||||||
} else {
|
|
||||||
// Browser globals (root is window)
|
|
||||||
root.download = factory();
|
|
||||||
}
|
|
||||||
}(this, function () {
|
|
||||||
|
|
||||||
return function download(data, strFileName, strMimeType) {
|
|
||||||
|
|
||||||
var self = window, // this script is only for browsers anyway...
|
|
||||||
defaultMime = "application/octet-stream", // this default mime also triggers iframe downloads
|
|
||||||
mimeType = strMimeType || defaultMime,
|
|
||||||
payload = data,
|
|
||||||
url = !strFileName && !strMimeType && payload,
|
|
||||||
anchor = document.createElement("a"),
|
|
||||||
toString = function(a){return String(a);},
|
|
||||||
myBlob = (self.Blob || self.MozBlob || self.WebKitBlob || toString),
|
|
||||||
fileName = strFileName || "download",
|
|
||||||
blob,
|
|
||||||
reader;
|
|
||||||
myBlob= myBlob.call ? myBlob.bind(self) : Blob ;
|
|
||||||
|
|
||||||
if(String(this)==="true"){ //reverse arguments, allowing download.bind(true, "text/xml", "export.xml") to act as a callback
|
|
||||||
payload=[payload, mimeType];
|
|
||||||
mimeType=payload[0];
|
|
||||||
payload=payload[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(url && url.length< 2048){ // if no filename and no mime, assume a url was passed as the only argument
|
|
||||||
fileName = url.split("/").pop().split("?")[0];
|
|
||||||
anchor.href = url; // assign href prop to temp anchor
|
|
||||||
if(anchor.href.indexOf(url) !== -1){ // if the browser determines that it's a potentially valid url path:
|
|
||||||
var ajax=new XMLHttpRequest();
|
|
||||||
ajax.open( "GET", url, true);
|
|
||||||
ajax.responseType = 'blob';
|
|
||||||
ajax.onload= function(e){
|
|
||||||
download(e.target.response, fileName, defaultMime);
|
|
||||||
};
|
|
||||||
setTimeout(function(){ ajax.send();}, 0); // allows setting custom ajax headers using the return:
|
|
||||||
return ajax;
|
|
||||||
} // end if valid url?
|
|
||||||
} // end if url?
|
|
||||||
|
|
||||||
|
|
||||||
//go ahead and download dataURLs right away
|
|
||||||
if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(payload)){
|
|
||||||
|
|
||||||
if(payload.length > (1024*1024*1.999) && myBlob !== toString ){
|
|
||||||
payload=dataUrlToBlob(payload);
|
|
||||||
mimeType=payload.type || defaultMime;
|
|
||||||
}else{
|
|
||||||
return navigator.msSaveBlob ? // IE10 can't do a[download], only Blobs:
|
|
||||||
navigator.msSaveBlob(dataUrlToBlob(payload), fileName) :
|
|
||||||
saver(payload) ; // everyone else can save dataURLs un-processed
|
|
||||||
}
|
|
||||||
|
|
||||||
}else{//not data url, is it a string with special needs?
|
|
||||||
if(/([\x80-\xff])/.test(payload)){
|
|
||||||
var i=0, tempUiArr= new Uint8Array(payload.length), mx=tempUiArr.length;
|
|
||||||
for(i;i<mx;++i) tempUiArr[i]= payload.charCodeAt(i);
|
|
||||||
payload=new myBlob([tempUiArr], {type: mimeType});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
blob = payload instanceof myBlob ?
|
|
||||||
payload :
|
|
||||||
new myBlob([payload], {type: mimeType}) ;
|
|
||||||
|
|
||||||
|
|
||||||
function dataUrlToBlob(strUrl) {
|
|
||||||
var parts= strUrl.split(/[:;,]/),
|
|
||||||
type= parts[1],
|
|
||||||
decoder= parts[2] == "base64" ? atob : decodeURIComponent,
|
|
||||||
binData= decoder( parts.pop() ),
|
|
||||||
mx= binData.length,
|
|
||||||
i= 0,
|
|
||||||
uiArr= new Uint8Array(mx);
|
|
||||||
|
|
||||||
for(i;i<mx;++i) uiArr[i]= binData.charCodeAt(i);
|
|
||||||
|
|
||||||
return new myBlob([uiArr], {type: type});
|
|
||||||
}
|
|
||||||
|
|
||||||
function saver(url, winMode){
|
|
||||||
|
|
||||||
if ('download' in anchor) { //html5 A[download]
|
|
||||||
anchor.href = url;
|
|
||||||
anchor.setAttribute("download", fileName);
|
|
||||||
anchor.className = "download-js-link";
|
|
||||||
anchor.innerHTML = "downloading...";
|
|
||||||
anchor.style.display = "none";
|
|
||||||
document.body.appendChild(anchor);
|
|
||||||
setTimeout(function() {
|
|
||||||
anchor.click();
|
|
||||||
document.body.removeChild(anchor);
|
|
||||||
if(winMode===true){setTimeout(function(){ self.URL.revokeObjectURL(anchor.href);}, 250 );}
|
|
||||||
}, 66);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// handle non-a[download] safari as best we can:
|
|
||||||
if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent)) {
|
|
||||||
if(/^data:/.test(url)) url="data:"+url.replace(/^data:([\w\/\-\+]+)/, defaultMime);
|
|
||||||
if(!window.open(url)){ // popup blocked, offer direct download:
|
|
||||||
if(confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")){ location.href=url; }
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//do iframe dataURL download (old ch+FF):
|
|
||||||
var f = document.createElement("iframe");
|
|
||||||
document.body.appendChild(f);
|
|
||||||
|
|
||||||
if(!winMode && /^data:/.test(url)){ // force a mime that will download:
|
|
||||||
url="data:"+url.replace(/^data:([\w\/\-\+]+)/, defaultMime);
|
|
||||||
}
|
|
||||||
f.src=url;
|
|
||||||
setTimeout(function(){ document.body.removeChild(f); }, 333);
|
|
||||||
|
|
||||||
}//end saver
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (navigator.msSaveBlob) { // IE10+ : (has Blob, but not a[download] or URL)
|
|
||||||
return navigator.msSaveBlob(blob, fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(self.URL){ // simple fast and modern way using Blob and URL:
|
|
||||||
saver(self.URL.createObjectURL(blob), true);
|
|
||||||
}else{
|
|
||||||
// handle non-Blob()+non-URL browsers:
|
|
||||||
if(typeof blob === "string" || blob.constructor===toString ){
|
|
||||||
try{
|
|
||||||
return saver( "data:" + mimeType + ";base64," + self.btoa(blob) );
|
|
||||||
}catch(y){
|
|
||||||
return saver( "data:" + mimeType + "," + encodeURIComponent(blob) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Blob but not URL support:
|
|
||||||
reader=new FileReader();
|
|
||||||
reader.onload=function(e){
|
|
||||||
saver(this.result);
|
|
||||||
};
|
|
||||||
reader.readAsDataURL(blob);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}; /* end download() */
|
|
||||||
}));
|
|
@ -1,38 +0,0 @@
|
|||||||
|
|
||||||
// Import injected libraries here!
|
|
||||||
|
|
||||||
import { Metadata, editMetadata as dependantEditMetadata} from "@stirling-pdf/shared-operations/functions/editMetadata";
|
|
||||||
import { extractPages as dependantExtractPages } from "@stirling-pdf/shared-operations/functions/extractPages";
|
|
||||||
import { mergePDFs as dependantMergePDFs } from '@stirling-pdf/shared-operations/functions/mergePDFs';
|
|
||||||
import { rotatePages as dependantRotatePages } from '@stirling-pdf/shared-operations/functions/rotatePages';
|
|
||||||
import { scaleContent as dependantScaleContent} from '@stirling-pdf/shared-operations/functions/scaleContent';
|
|
||||||
import { scalePage as dependantScalePage } from '@stirling-pdf/shared-operations/functions/scalePage';
|
|
||||||
import { splitPDF as dependantSplitPDF } from '@stirling-pdf/shared-operations/functions/splitPDF';
|
|
||||||
|
|
||||||
export async function editMetadata(snapshot: string | Uint8Array | ArrayBuffer, metadata: Metadata) {
|
|
||||||
return dependantEditMetadata(snapshot, metadata);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function extractPages(snapshot: string | Uint8Array | ArrayBuffer, pageIndexes: number[]) {
|
|
||||||
return dependantExtractPages(snapshot, pageIndexes);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function mergePDFs(snapshots: (string | Uint8Array | ArrayBuffer)[]) {
|
|
||||||
return dependantMergePDFs(snapshots);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function rotatePages(snapshot: string | Uint8Array | ArrayBuffer, rotation: number) {
|
|
||||||
return dependantRotatePages(snapshot, rotation);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function scaleContent(snapshot: string | Uint8Array | ArrayBuffer, scaleFactor: number) {
|
|
||||||
return dependantScaleContent(snapshot, scaleFactor);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function scalePage(snapshot: string | Uint8Array | ArrayBuffer, pageSize: { width: number; height: number; }) {
|
|
||||||
return dependantScalePage(snapshot, pageSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function splitPDF(snapshot: string | Uint8Array | ArrayBuffer, splitAfterPageArray: number[]) {
|
|
||||||
return dependantSplitPDF(snapshot, splitAfterPageArray);
|
|
||||||
}
|
|
1
client-ionic/src/vite-env.d.ts
vendored
1
client-ionic/src/vite-env.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
/// <reference types="vite/client" />
|
|
@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "ESNext",
|
|
||||||
"useDefineForClassFields": true,
|
|
||||||
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
||||||
"allowJs": false,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"esModuleInterop": false,
|
|
||||||
"allowSyntheticDefaultImports": true,
|
|
||||||
"strict": true,
|
|
||||||
"forceConsistentCasingInFileNames": true,
|
|
||||||
"module": "ESNext",
|
|
||||||
"moduleResolution": "Node",
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"isolatedModules": true,
|
|
||||||
"noEmit": true,
|
|
||||||
"jsx": "react-jsx"
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"src",
|
|
||||||
"declarations/*.d.ts"
|
|
||||||
],
|
|
||||||
"references": [{ "path": "./tsconfig.node.json" }]
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"composite": true,
|
|
||||||
"module": "ESNext",
|
|
||||||
"moduleResolution": "Node",
|
|
||||||
"allowSyntheticDefaultImports": true
|
|
||||||
},
|
|
||||||
"include": ["vite.config.ts"]
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
import legacy from '@vitejs/plugin-legacy'
|
|
||||||
import react from '@vitejs/plugin-react'
|
|
||||||
import { defineConfig } from 'vite'
|
|
||||||
import { VitePWA } from 'vite-plugin-pwa'; // https://ionicframework.com/docs/react/pwa
|
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
|
||||||
export default defineConfig({
|
|
||||||
plugins: [
|
|
||||||
react(),
|
|
||||||
VitePWA({ registerType: 'autoUpdate' }),
|
|
||||||
legacy()
|
|
||||||
],
|
|
||||||
test: {
|
|
||||||
globals: true,
|
|
||||||
environment: 'jsdom',
|
|
||||||
setupFiles: './src/setupTests.ts',
|
|
||||||
}
|
|
||||||
})
|
|
@ -1,7 +1,7 @@
|
|||||||
import Joi from "joi";
|
import Joi from "joi";
|
||||||
import { PdfFile } from "./PdfFile";
|
import { PdfFile } from "./PdfFile";
|
||||||
|
|
||||||
export const JoiPDFFileSchema = Joi.custom((value: Express.Multer.File | Express.Multer.File[] | PdfFile | PdfFile[], helpers) => {
|
export const JoiPDFFileSchema = Joi.custom((value: Express.Multer.File[] /* <- also handles single files */ | PdfFile[] | PdfFile, helpers) => {
|
||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
if(isPdfFileArray(value))
|
if(isPdfFileArray(value))
|
||||||
return value;
|
return value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user