add sentry
This commit is contained in:
parent
c7cd229cae
commit
4d74e55265
13
README.md
13
README.md
@ -1,7 +1,5 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# **Open Source Stock Analysis for Data Freaks**
|
# **Open Source Stock Analysis for Data Freaks**
|
||||||
|
|
||||||
<h3>
|
<h3>
|
||||||
@ -14,30 +12,35 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Techstack
|
# Techstack
|
||||||
|
|
||||||
This is the codebase that powers [stocknear's](https://stocknear.com/) frontend, which is an open-source stock analysis & community platform.
|
This is the codebase that powers [stocknear's](https://stocknear.com/) frontend, which is an open-source stock analysis & community platform.
|
||||||
|
|
||||||
Built with:
|
Built with:
|
||||||
|
|
||||||
- [Sveltekit](https://kit.svelte.dev/): Frontend
|
- [Sveltekit](https://kit.svelte.dev/): Frontend
|
||||||
- [Tailwindcss](https://tailwindcss.com/): Styling
|
- [Tailwindcss](https://tailwindcss.com/): Styling
|
||||||
- [DaisyUI](https://daisyui.com/): Styling
|
- [DaisyUI](https://daisyui.com/): Styling
|
||||||
|
|
||||||
# Getting started
|
# Getting started
|
||||||
|
|
||||||
Coming soon to run stocknear locally on your machine.
|
Coming soon to run stocknear locally on your machine.
|
||||||
|
|
||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
Stocknear is open-source software and you're welcome to contribute to its development.
|
Stocknear is open-source software and you're welcome to contribute to its development.
|
||||||
|
|
||||||
The core idea of stocknear shall always be: ***Fast*** & ***Simple***.
|
The core idea of stocknear shall always be: **_Fast_** & **_Simple_**.
|
||||||
|
|
||||||
If want to contribute to the codebase please follow these guidelines:
|
If want to contribute to the codebase please follow these guidelines:
|
||||||
|
|
||||||
- Refactoring slow code into fast code is a huge plus!
|
- Refactoring slow code into fast code is a huge plus!
|
||||||
- Reducing complexity and increasing simplicity/readability is a huge plus!
|
- Reducing complexity and increasing simplicity/readability is a huge plus!
|
||||||
- If your PR looks "complex", is a big diff, or adds lots of lines, it won't be reviewed or merged. Consider breaking it up into smaller PRs that are individually clear wins. A common pattern I see is prerequisite refactors before adding new functionality. If you can (cleanly) refactor to the point that the feature is a 3 line change, this is great, and something easy for us to review.
|
- If your PR looks "complex", is a big diff, or adds lots of lines, it won't be reviewed or merged. Consider breaking it up into smaller PRs that are individually clear wins. A common pattern I see is prerequisite refactors before adding new functionality. If you can (cleanly) refactor to the point that the feature is a 3 line change, this is great, and something easy for us to review.
|
||||||
|
|
||||||
# Support ❤️
|
# Support ❤️
|
||||||
|
|
||||||
If you love the idea of stocknear and want to support our mission you can help us in two ways:
|
If you love the idea of stocknear and want to support our mission you can help us in two ways:
|
||||||
|
|
||||||
- Become a [Pro Member](https://stocknear.com/pricing) of stocknear to get unlimited feature access to enjoy the platform to the fullest.
|
- Become a [Pro Member](https://stocknear.com/pricing) of stocknear to get unlimited feature access to enjoy the platform to the fullest.
|
||||||
- You can donate money via [Ko-fi](https://ko-fi.com/stocknear) to help us pay the servers & data providers to keep everything running!
|
- You can donate money via [Ko-fi](https://ko-fi.com/stocknear) to help us pay the servers & data providers to keep everything running!
|
||||||
|
|||||||
@ -1,17 +1,17 @@
|
|||||||
{
|
{
|
||||||
"extends": "./.svelte-kit/tsconfig.json",
|
"extends": "./.svelte-kit/tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"checkJs": true,
|
"checkJs": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"strict": true
|
"strict": true
|
||||||
}
|
}
|
||||||
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files
|
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files
|
||||||
//
|
//
|
||||||
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
|
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
|
||||||
// from the referenced tsconfig.json - TypeScript does not merge them in
|
// from the referenced tsconfig.json - TypeScript does not merge them in
|
||||||
}
|
}
|
||||||
|
|||||||
2035
package-lock.json
generated
2035
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -98,6 +98,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-s3": "^3.556.0",
|
"@aws-sdk/client-s3": "^3.556.0",
|
||||||
|
"@sentry/sveltekit": "^8.30.0",
|
||||||
"greeks": "^1.0.0",
|
"greeks": "^1.0.0",
|
||||||
"html2canvas": "^1.4.1",
|
"html2canvas": "^1.4.1",
|
||||||
"https": "^1.0.0",
|
"https": "^1.0.0",
|
||||||
|
|||||||
@ -1,18 +1,18 @@
|
|||||||
import { defineConfig, devices } from '@playwright/test'; // import devices
|
import { defineConfig, devices } from "@playwright/test"; // import devices
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
testDir: 'tests',
|
testDir: "tests",
|
||||||
projects: [
|
projects: [
|
||||||
{
|
{
|
||||||
name: 'chromium',
|
name: "chromium",
|
||||||
use: {
|
use: {
|
||||||
...devices['Desktop Chrome'],
|
...devices["Desktop Chrome"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'safari',
|
name: "safari",
|
||||||
use: {
|
use: {
|
||||||
...devices['Iphone 6'],
|
...devices["Iphone 6"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
plugins: {
|
plugins: {
|
||||||
tailwindcss: {},
|
tailwindcss: {},
|
||||||
|
|
||||||
autoprefixer: {},
|
autoprefixer: {},
|
||||||
|
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
|
|||||||
131
src/app.css
131
src/app.css
@ -2,10 +2,6 @@
|
|||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.table {
|
.table {
|
||||||
@apply text-left text-sm rtl:text-right;
|
@apply text-left text-sm rtl:text-right;
|
||||||
:where(th, td) {
|
:where(th, td) {
|
||||||
@ -45,7 +41,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@layer utilities {
|
@layer utilities {
|
||||||
.no-scrollbar {
|
.no-scrollbar {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
@ -54,14 +49,14 @@
|
|||||||
|
|
||||||
/* Styles for WebKit browsers (Chrome, Safari, newer versions of Opera) */
|
/* Styles for WebKit browsers (Chrome, Safari, newer versions of Opera) */
|
||||||
.no-scrollbar::-webkit-scrollbar {
|
.no-scrollbar::-webkit-scrollbar {
|
||||||
width: auto; /* Keep the width for vertical scrollbar */
|
width: auto; /* Keep the width for vertical scrollbar */
|
||||||
height: 0; /* Set height to 0 to hide horizontal scrollbar */
|
height: 0; /* Set height to 0 to hide horizontal scrollbar */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Styles for Firefox */
|
/* Styles for Firefox */
|
||||||
.no-scrollbar {
|
.no-scrollbar {
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
scrollbar-color: auto transparent; /* vertical scrollbar color, then track color */
|
scrollbar-color: auto transparent; /* vertical scrollbar color, then track color */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Styles for Internet Explorer and Edge */
|
/* Styles for Internet Explorer and Edge */
|
||||||
@ -69,84 +64,86 @@
|
|||||||
-ms-overflow-style: -ms-autohiding-scrollbar;
|
-ms-overflow-style: -ms-autohiding-scrollbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.shake-ticker:hover img {
|
||||||
|
animation-name: shake;
|
||||||
|
animation-duration: 0.5s;
|
||||||
|
animation-iteration-count: infinite;
|
||||||
|
animation-timing-function: ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
.shake-ticker:hover img {
|
@keyframes shake {
|
||||||
animation-name: shake;
|
0% {
|
||||||
animation-duration: 0.5s;
|
transform: rotate(0deg);
|
||||||
animation-iteration-count: infinite;
|
|
||||||
animation-timing-function: ease-in-out;
|
|
||||||
}
|
}
|
||||||
|
25% {
|
||||||
|
transform: rotate(10deg);
|
||||||
@keyframes shake {
|
|
||||||
0% { transform: rotate(0deg); }
|
|
||||||
25% { transform: rotate(10deg); }
|
|
||||||
50% { transform: rotate(0deg); }
|
|
||||||
75% { transform: rotate(-10deg); }
|
|
||||||
100% { transform: rotate(0deg); }
|
|
||||||
}
|
}
|
||||||
|
50% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
75% {
|
||||||
|
transform: rotate(-10deg);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.loader,
|
.loader,
|
||||||
.loader:before,
|
.loader:before,
|
||||||
.loader:after {
|
.loader:after {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
width: 2.5em;
|
width: 2.5em;
|
||||||
height: 2.5em;
|
height: 2.5em;
|
||||||
-webkit-animation-fill-mode: both;
|
-webkit-animation-fill-mode: both;
|
||||||
animation-fill-mode: both;
|
animation-fill-mode: both;
|
||||||
-webkit-animation: load7 0.8s infinite ease-in-out;
|
-webkit-animation: load7 0.8s infinite ease-in-out;
|
||||||
animation: load7 0.8s infinite ease-in-out;
|
animation: load7 0.8s infinite ease-in-out;
|
||||||
}
|
}
|
||||||
.loader {
|
.loader {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
margin: 80px auto;
|
margin: 80px auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
text-indent: -9999em;
|
text-indent: -9999em;
|
||||||
-webkit-transform: translateZ(0);
|
-webkit-transform: translateZ(0);
|
||||||
-ms-transform: translateZ(0);
|
-ms-transform: translateZ(0);
|
||||||
transform: translateZ(0);
|
transform: translateZ(0);
|
||||||
-webkit-animation-delay: -0.16s;
|
-webkit-animation-delay: -0.16s;
|
||||||
animation-delay: -0.16s;
|
animation-delay: -0.16s;
|
||||||
}
|
}
|
||||||
.loader:before,
|
.loader:before,
|
||||||
.loader:after {
|
.loader:after {
|
||||||
content: '';
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
.loader:before {
|
.loader:before {
|
||||||
left: -3.5em;
|
left: -3.5em;
|
||||||
-webkit-animation-delay: -0.32s;
|
-webkit-animation-delay: -0.32s;
|
||||||
animation-delay: -0.32s;
|
animation-delay: -0.32s;
|
||||||
}
|
}
|
||||||
.loader:after {
|
.loader:after {
|
||||||
left: 3.5em;
|
left: 3.5em;
|
||||||
}
|
}
|
||||||
@-webkit-keyframes load7 {
|
@-webkit-keyframes load7 {
|
||||||
0%,
|
0%,
|
||||||
80%,
|
80%,
|
||||||
100% {
|
100% {
|
||||||
box-shadow: 0 2.5em 0 -1.3em;
|
box-shadow: 0 2.5em 0 -1.3em;
|
||||||
}
|
}
|
||||||
40% {
|
40% {
|
||||||
box-shadow: 0 2.5em 0 0;
|
box-shadow: 0 2.5em 0 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@keyframes load7 {
|
@keyframes load7 {
|
||||||
0%,
|
0%,
|
||||||
80%,
|
80%,
|
||||||
100% {
|
100% {
|
||||||
box-shadow: 0 2.5em 0 -1.3em;
|
box-shadow: 0 2.5em 0 -1.3em;
|
||||||
|
}
|
||||||
|
40% {
|
||||||
|
box-shadow: 0 2.5em 0 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
40% {
|
|
||||||
box-shadow: 0 2.5em 0 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
9
src/app.d.ts
vendored
9
src/app.d.ts
vendored
@ -2,13 +2,12 @@
|
|||||||
// for information about these interfaces
|
// for information about these interfaces
|
||||||
// and what to do when importing types
|
// and what to do when importing types
|
||||||
declare namespace App {
|
declare namespace App {
|
||||||
// interface Error {}
|
// interface Error {}
|
||||||
// interface Locals {}
|
// interface Locals {}
|
||||||
// interface PageData {}
|
// interface PageData {}
|
||||||
// interface Platform {}
|
// interface Platform {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// src/app.d.ts
|
// src/app.d.ts
|
||||||
/*
|
/*
|
||||||
import PocketBase from "pocketbase";
|
import PocketBase from "pocketbase";
|
||||||
|
|||||||
33
src/app.html
33
src/app.html
@ -1,22 +1,19 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
|
|
||||||
<html lang="en" class="bg-[#09090B]">
|
<html lang="en" class="bg-[#09090B]">
|
||||||
|
<head>
|
||||||
|
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||||
|
<link rel="manifest" href="%sveltekit.assets%/manifest.json" />
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
%sveltekit.head%
|
||||||
|
</head>
|
||||||
|
|
||||||
<head>
|
<!-- Global background color -->
|
||||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
<body
|
||||||
<link rel="manifest" href="%sveltekit.assets%/manifest.json" />
|
data-sveltekit-preload-data="hover"
|
||||||
<meta charset="utf-8" />
|
class="bg-[#09090B] overflow-x-hidden"
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
>
|
||||||
%sveltekit.head%
|
<div>%sveltekit.body%</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<!-- Global background color -->
|
|
||||||
<body data-sveltekit-preload-data="hover" class="bg-[#09090B] overflow-x-hidden">
|
|
||||||
<div>%sveltekit.body%</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -69,4 +69,3 @@
|
|||||||
--radius: 0.5rem;
|
--radius: 0.5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
11
src/hooks.client.js
Normal file
11
src/hooks.client.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit";
|
||||||
|
import * as Sentry from "@sentry/sveltekit";
|
||||||
|
|
||||||
|
Sentry.init({
|
||||||
|
dsn: import.meta.env.VITE_SENTRY,
|
||||||
|
|
||||||
|
tracesSampleRate: 1.0,
|
||||||
|
});
|
||||||
|
|
||||||
|
// If you have a custom error handler, pass it to `handleErrorWithSentry`
|
||||||
|
export const handleError = handleErrorWithSentry();
|
||||||
@ -1,75 +1,86 @@
|
|||||||
|
import { sequence } from "@sveltejs/kit/hooks";
|
||||||
|
import * as Sentry from "@sentry/sveltekit";
|
||||||
import PocketBase from "pocketbase";
|
import PocketBase from "pocketbase";
|
||||||
import { serializeNonPOJOs } from "$lib/utils";
|
import { serializeNonPOJOs } from "$lib/utils";
|
||||||
|
|
||||||
export const handle = async ({ event, resolve }) => {
|
Sentry.init({
|
||||||
// Use optional chaining and nullish coalescing for safer property access
|
dsn: import.meta.env.VITE_SENTRY,
|
||||||
const regionHeader =
|
tracesSampleRate: 1,
|
||||||
event?.request?.headers?.get("x-vercel-id") ??
|
});
|
||||||
"fra1::fra1::8t4xg-1700258428633-157d82fdfcc7";
|
|
||||||
|
|
||||||
const ip =
|
export const handle = sequence(
|
||||||
event.request.headers.get("x-forwarded-for") ||
|
Sentry.sentryHandle(),
|
||||||
event.request.headers.get("remote-address");
|
async ({ event, resolve }) => {
|
||||||
|
// Use optional chaining and nullish coalescing for safer property access
|
||||||
|
const regionHeader =
|
||||||
|
event?.request?.headers?.get("x-vercel-id") ??
|
||||||
|
"fra1::fra1::8t4xg-1700258428633-157d82fdfcc7";
|
||||||
|
|
||||||
let isUS = false;
|
const ip =
|
||||||
|
event.request.headers.get("x-forwarded-for") ||
|
||||||
|
event.request.headers.get("remote-address");
|
||||||
|
|
||||||
if (ip) {
|
let isUS = false;
|
||||||
const geoResponse = await fetch(`https://ipinfo.io/${ip}/geo`);
|
|
||||||
const geoData = await geoResponse.json();
|
if (ip) {
|
||||||
if (geoData.country === "US") {
|
const geoResponse = await fetch(`https://ipinfo.io/${ip}/geo`);
|
||||||
isUS = true;
|
const geoData = await geoResponse.json();
|
||||||
//console.log("yelllo", geoData);
|
if (geoData.country === "US") {
|
||||||
|
isUS = true;
|
||||||
|
//console.log("yelllo", geoData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Use a ternary operator instead of the logical OR for better compatibility
|
// Use a ternary operator instead of the logical OR for better compatibility
|
||||||
const pbURL = isUS
|
const pbURL = isUS
|
||||||
? import.meta.env.VITE_USEAST_POCKETBASE_URL
|
? import.meta.env.VITE_USEAST_POCKETBASE_URL
|
||||||
: import.meta.env.VITE_EU_POCKETBASE_URL;
|
: import.meta.env.VITE_EU_POCKETBASE_URL;
|
||||||
const apiURL = isUS
|
const apiURL = isUS
|
||||||
? import.meta.env.VITE_USEAST_API_URL
|
? import.meta.env.VITE_USEAST_API_URL
|
||||||
: import.meta.env.VITE_EU_API_URL;
|
: import.meta.env.VITE_EU_API_URL;
|
||||||
const fastifyURL = isUS
|
const fastifyURL = isUS
|
||||||
? import.meta.env.VITE_USEAST_FASTIFY_URL
|
? import.meta.env.VITE_USEAST_FASTIFY_URL
|
||||||
: import.meta.env.VITE_EU_FASTIFY_URL;
|
: import.meta.env.VITE_EU_FASTIFY_URL;
|
||||||
const wsURL = isUS
|
const wsURL = isUS
|
||||||
? import.meta.env.VITE_USEAST_WS_URL
|
? import.meta.env.VITE_USEAST_WS_URL
|
||||||
: import.meta.env.VITE_EU_WS_URL;
|
: import.meta.env.VITE_EU_WS_URL;
|
||||||
|
|
||||||
event.locals = {
|
event.locals = {
|
||||||
region: decodeURIComponent(regionHeader),
|
region: decodeURIComponent(regionHeader),
|
||||||
pb: new PocketBase(pbURL),
|
pb: new PocketBase(pbURL),
|
||||||
apiURL,
|
apiURL,
|
||||||
fastifyURL,
|
fastifyURL,
|
||||||
wsURL,
|
wsURL,
|
||||||
apiKey: import.meta.env.VITE_STOCKNEAR_API_KEY,
|
apiKey: import.meta.env.VITE_STOCKNEAR_API_KEY,
|
||||||
};
|
};
|
||||||
|
|
||||||
const authCookie = event?.request?.headers?.get("cookie") || "";
|
const authCookie = event?.request?.headers?.get("cookie") || "";
|
||||||
event.locals.pb.authStore.loadFromCookie(authCookie);
|
event.locals.pb.authStore.loadFromCookie(authCookie);
|
||||||
|
|
||||||
if (event?.locals?.pb?.authStore?.isValid) {
|
if (event?.locals?.pb?.authStore?.isValid) {
|
||||||
try {
|
try {
|
||||||
await event.locals.pb.collection("users").authRefresh();
|
await event.locals.pb.collection("users").authRefresh();
|
||||||
event.locals.user = serializeNonPOJOs(event.locals.pb.authStore.model);
|
event.locals.user = serializeNonPOJOs(event.locals.pb.authStore.model);
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
event.locals.pb.authStore.clear();
|
event.locals.pb.authStore.clear();
|
||||||
event.locals.user = undefined;
|
event.locals.user = undefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const response = await resolve(event);
|
||||||
|
|
||||||
|
// Use a more compatible way to set the cookie
|
||||||
|
const cookieString = event.locals.pb.authStore.exportToCookie({
|
||||||
|
httpOnly: true,
|
||||||
|
path: "/",
|
||||||
|
sameSite: "lax",
|
||||||
|
secure: true,
|
||||||
|
maxAge: 60 * 60 * 24 * 365,
|
||||||
|
});
|
||||||
|
|
||||||
|
response.headers.append("set-cookie", cookieString);
|
||||||
|
|
||||||
|
return response;
|
||||||
}
|
}
|
||||||
|
);
|
||||||
const response = await resolve(event);
|
export const handleError = Sentry.handleErrorWithSentry();
|
||||||
|
|
||||||
// Use a more compatible way to set the cookie
|
|
||||||
const cookieString = event.locals.pb.authStore.exportToCookie({
|
|
||||||
httpOnly: true,
|
|
||||||
path: "/",
|
|
||||||
sameSite: "lax",
|
|
||||||
secure: true,
|
|
||||||
maxAge: 60 * 60 * 24 * 365,
|
|
||||||
});
|
|
||||||
|
|
||||||
response.headers.append("set-cookie", cookieString);
|
|
||||||
|
|
||||||
return response;
|
|
||||||
};
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { describe, it, expect } from 'vitest';
|
import { describe, it, expect } from "vitest";
|
||||||
|
|
||||||
describe('sum test', () => {
|
describe("sum test", () => {
|
||||||
it('adds 1 + 2 to equal 3', () => {
|
it("adds 1 + 2 to equal 3", () => {
|
||||||
expect(1 + 2).toBe(3);
|
expect(1 + 2).toBe(3);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1,186 +1,207 @@
|
|||||||
.driver-active .driver-overlay, .driver-active * {
|
.driver-active .driver-overlay,
|
||||||
pointer-events: none;
|
.driver-active * {
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
.driver-active .driver-active-element, .driver-active .driver-active-element *, .driver-popover, .driver-popover * {
|
.driver-active .driver-active-element,
|
||||||
pointer-events: auto;
|
.driver-active .driver-active-element *,
|
||||||
|
.driver-popover,
|
||||||
|
.driver-popover * {
|
||||||
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
@keyframes animate-fade-in {
|
@keyframes animate-fade-in {
|
||||||
0% {
|
0% {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
to {
|
to {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}.driver-fade .driver-overlay {
|
.driver-fade .driver-overlay {
|
||||||
animation: animate-fade-in .2s ease-in-out;
|
animation: animate-fade-in 0.2s ease-in-out;
|
||||||
}
|
}
|
||||||
.driver-fade .driver-popover {
|
.driver-fade .driver-popover {
|
||||||
animation: animate-fade-in .2s;
|
animation: animate-fade-in 0.2s;
|
||||||
}
|
}
|
||||||
.driver-popover {
|
.driver-popover {
|
||||||
all: unset;
|
all: unset;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
border-radius: 0px;
|
border-radius: 0px;
|
||||||
min-width: 250px;
|
min-width: 250px;
|
||||||
max-width: 500px;
|
max-width: 500px;
|
||||||
box-shadow: 0 1px 10px #0006;
|
box-shadow: 0 1px 10px #0006;
|
||||||
z-index: 1000000000;
|
z-index: 1000000000;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
background-color: #202327;
|
background-color: #202327;
|
||||||
}
|
}
|
||||||
.driver-popover * {
|
.driver-popover * {
|
||||||
font-family: Helvetica Neue, Inter, ui-sans-serif, "Apple Color Emoji", Helvetica, Arial, sans-serif;
|
font-family:
|
||||||
|
Helvetica Neue,
|
||||||
|
Inter,
|
||||||
|
ui-sans-serif,
|
||||||
|
"Apple Color Emoji",
|
||||||
|
Helvetica,
|
||||||
|
Arial,
|
||||||
|
sans-serif;
|
||||||
}
|
}
|
||||||
.driver-popover-title {
|
.driver-popover-title {
|
||||||
font: 19px/normal sans-serif;
|
font: 19px / normal sans-serif;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
zoom: 1;
|
zoom: 1;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
.driver-popover-close-btn {
|
.driver-popover-close-btn {
|
||||||
all: unset;
|
all: unset;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
width: 32px;
|
width: 32px;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #d2d2d2;
|
color: #d2d2d2;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
transition: color;
|
transition: color;
|
||||||
transition-duration: .2s;
|
transition-duration: 0.2s;
|
||||||
}
|
}
|
||||||
.driver-popover-close-btn:hover, .driver-popover-close-btn:focus {
|
.driver-popover-close-btn:hover,
|
||||||
color: #2d2d2d;
|
.driver-popover-close-btn:focus {
|
||||||
|
color: #2d2d2d;
|
||||||
}
|
}
|
||||||
.driver-popover-title[style*=block]+.driver-popover-description {
|
.driver-popover-title[style*="block"] + .driver-popover-description {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
.driver-popover-description {
|
.driver-popover-description {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
font: 16px/normal sans-serif;
|
font: 16px / normal sans-serif;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
zoom: 1;
|
zoom: 1;
|
||||||
}
|
}
|
||||||
.driver-popover-footer {
|
.driver-popover-footer {
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
zoom: 1;
|
zoom: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
.driver-popover-progress-text {
|
.driver-popover-progress-text {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
zoom: 1;
|
zoom: 1;
|
||||||
}
|
}
|
||||||
.driver-popover-footer button {
|
.driver-popover-footer button {
|
||||||
all: unset;
|
all: unset;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 8px 20px;
|
padding: 8px 20px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
text-shadow: 1px 1px 0 #fff;
|
text-shadow: 1px 1px 0 #fff;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
color: #2d2d2d;
|
color: #2d2d2d;
|
||||||
font: 14px/normal sans-serif;
|
font: 14px / normal sans-serif;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
outline: 0;
|
outline: 0;
|
||||||
zoom: 1;
|
zoom: 1;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
.driver-popover-footer .driver-popover-btn-disabled {
|
.driver-popover-footer .driver-popover-btn-disabled {
|
||||||
opacity: .5;
|
opacity: 0.5;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
:not(body):has(>.driver-active-element) {
|
:not(body):has(> .driver-active-element) {
|
||||||
overflow: hidden!important;
|
overflow: hidden !important;
|
||||||
}
|
}
|
||||||
.driver-no-interaction, .driver-no-interaction * {
|
.driver-no-interaction,
|
||||||
pointer-events: none!important;
|
.driver-no-interaction * {
|
||||||
|
pointer-events: none !important;
|
||||||
}
|
}
|
||||||
.driver-popover-footer button:hover, .driver-popover-footer button:focus {
|
.driver-popover-footer button:hover,
|
||||||
background-color: #f7f7f7;
|
.driver-popover-footer button:focus {
|
||||||
|
background-color: #f7f7f7;
|
||||||
}
|
}
|
||||||
.driver-popover-navigation-btns {
|
.driver-popover-navigation-btns {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
.driver-popover-navigation-btns button+button {
|
.driver-popover-navigation-btns button + button {
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
}
|
}
|
||||||
.driver-popover-arrow {
|
.driver-popover-arrow {
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border: 5px solid #fff;
|
border: 5px solid #fff;
|
||||||
}
|
}
|
||||||
.driver-popover-arrow-side-over {
|
.driver-popover-arrow-side-over {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.driver-popover-arrow-side-left {
|
.driver-popover-arrow-side-left {
|
||||||
left: 100%;
|
left: 100%;
|
||||||
border-right-color: transparent;
|
border-right-color: transparent;
|
||||||
border-bottom-color: transparent;
|
border-bottom-color: transparent;
|
||||||
border-top-color: transparent;
|
border-top-color: transparent;
|
||||||
}
|
}
|
||||||
.driver-popover-arrow-side-right {
|
.driver-popover-arrow-side-right {
|
||||||
right: 100%;
|
right: 100%;
|
||||||
border-left-color: transparent;
|
border-left-color: transparent;
|
||||||
border-bottom-color: transparent;
|
border-bottom-color: transparent;
|
||||||
border-top-color: transparent;
|
border-top-color: transparent;
|
||||||
}
|
}
|
||||||
.driver-popover-arrow-side-top {
|
.driver-popover-arrow-side-top {
|
||||||
top: 100%;
|
top: 100%;
|
||||||
border-right-color: transparent;
|
border-right-color: transparent;
|
||||||
border-bottom-color: transparent;
|
border-bottom-color: transparent;
|
||||||
border-left-color: transparent;
|
border-left-color: transparent;
|
||||||
}
|
}
|
||||||
.driver-popover-arrow-side-bottom {
|
.driver-popover-arrow-side-bottom {
|
||||||
bottom: 100%;
|
bottom: 100%;
|
||||||
border-left-color: transparent;
|
border-left-color: transparent;
|
||||||
border-top-color: transparent;
|
border-top-color: transparent;
|
||||||
border-right-color: transparent;
|
border-right-color: transparent;
|
||||||
}
|
}
|
||||||
.driver-popover-arrow-side-center {
|
.driver-popover-arrow-side-center {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.driver-popover-arrow-side-left.driver-popover-arrow-align-start, .driver-popover-arrow-side-right.driver-popover-arrow-align-start {
|
.driver-popover-arrow-side-left.driver-popover-arrow-align-start,
|
||||||
top: 15px;
|
.driver-popover-arrow-side-right.driver-popover-arrow-align-start {
|
||||||
|
top: 15px;
|
||||||
}
|
}
|
||||||
.driver-popover-arrow-side-top.driver-popover-arrow-align-start, .driver-popover-arrow-side-bottom.driver-popover-arrow-align-start {
|
.driver-popover-arrow-side-top.driver-popover-arrow-align-start,
|
||||||
left: 15px;
|
.driver-popover-arrow-side-bottom.driver-popover-arrow-align-start {
|
||||||
|
left: 15px;
|
||||||
}
|
}
|
||||||
.driver-popover-arrow-align-end.driver-popover-arrow-side-left, .driver-popover-arrow-align-end.driver-popover-arrow-side-right {
|
.driver-popover-arrow-align-end.driver-popover-arrow-side-left,
|
||||||
bottom: 15px;
|
.driver-popover-arrow-align-end.driver-popover-arrow-side-right {
|
||||||
|
bottom: 15px;
|
||||||
}
|
}
|
||||||
.driver-popover-arrow-side-top.driver-popover-arrow-align-end, .driver-popover-arrow-side-bottom.driver-popover-arrow-align-end {
|
.driver-popover-arrow-side-top.driver-popover-arrow-align-end,
|
||||||
right: 15px;
|
.driver-popover-arrow-side-bottom.driver-popover-arrow-align-end {
|
||||||
|
right: 15px;
|
||||||
}
|
}
|
||||||
.driver-popover-arrow-side-left.driver-popover-arrow-align-center, .driver-popover-arrow-side-right.driver-popover-arrow-align-center {
|
.driver-popover-arrow-side-left.driver-popover-arrow-align-center,
|
||||||
top: 50%;
|
.driver-popover-arrow-side-right.driver-popover-arrow-align-center {
|
||||||
margin-top: -5px;
|
top: 50%;
|
||||||
|
margin-top: -5px;
|
||||||
}
|
}
|
||||||
.driver-popover-arrow-side-top.driver-popover-arrow-align-center, .driver-popover-arrow-side-bottom.driver-popover-arrow-align-center {
|
.driver-popover-arrow-side-top.driver-popover-arrow-align-center,
|
||||||
left: 50%;
|
.driver-popover-arrow-side-bottom.driver-popover-arrow-align-center {
|
||||||
margin-left: -5px;
|
left: 50%;
|
||||||
|
margin-left: -5px;
|
||||||
}
|
}
|
||||||
.driver-popover-arrow-none {
|
.driver-popover-arrow-none {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -1,3 +1,3 @@
|
|||||||
import Info from './Info.svelte';
|
import Info from "./Info.svelte";
|
||||||
|
|
||||||
export {Info};
|
export { Info };
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -5,13 +5,13 @@ import Trigger from "./accordion-trigger.svelte";
|
|||||||
const Root = AccordionPrimitive.Root;
|
const Root = AccordionPrimitive.Root;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Root,
|
Root,
|
||||||
Content,
|
Content,
|
||||||
Item,
|
Item,
|
||||||
Trigger,
|
Trigger,
|
||||||
//
|
//
|
||||||
Root as Accordion,
|
Root as Accordion,
|
||||||
Content as AccordionContent,
|
Content as AccordionContent,
|
||||||
Item as AccordionItem,
|
Item as AccordionItem,
|
||||||
Trigger as AccordionTrigger,
|
Trigger as AccordionTrigger,
|
||||||
};
|
};
|
||||||
@ -5,29 +5,29 @@ import Description from "./alert-description.svelte";
|
|||||||
import Title from "./alert-title.svelte";
|
import Title from "./alert-title.svelte";
|
||||||
|
|
||||||
export const alertVariants = tv({
|
export const alertVariants = tv({
|
||||||
base: "relative w-full rounded-lg border p-4 [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
base: "relative w-full rounded-lg border p-4 [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
||||||
|
|
||||||
variants: {
|
variants: {
|
||||||
variant: {
|
variant: {
|
||||||
default: "bg-background text-foreground",
|
default: "bg-background text-foreground",
|
||||||
destructive:
|
destructive:
|
||||||
"border-destructive/50 text-destructive text-destructive dark:border-destructive [&>svg]:text-destructive",
|
"border-destructive/50 text-destructive text-destructive dark:border-destructive [&>svg]:text-destructive",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
defaultVariants: {
|
defaultVariants: {
|
||||||
variant: "default",
|
variant: "default",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export type Variant = VariantProps<typeof alertVariants>["variant"];
|
export type Variant = VariantProps<typeof alertVariants>["variant"];
|
||||||
export type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
export type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Root,
|
Root,
|
||||||
Description,
|
Description,
|
||||||
Title,
|
Title,
|
||||||
//
|
//
|
||||||
Root as Alert,
|
Root as Alert,
|
||||||
Description as AlertDescription,
|
Description as AlertDescription,
|
||||||
Title as AlertTitle,
|
Title as AlertTitle,
|
||||||
};
|
};
|
||||||
@ -3,11 +3,11 @@ import Image from "./avatar-image.svelte";
|
|||||||
import Fallback from "./avatar-fallback.svelte";
|
import Fallback from "./avatar-fallback.svelte";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Root,
|
Root,
|
||||||
Image,
|
Image,
|
||||||
Fallback,
|
Fallback,
|
||||||
//
|
//
|
||||||
Root as Avatar,
|
Root as Avatar,
|
||||||
Image as AvatarImage,
|
Image as AvatarImage,
|
||||||
Fallback as AvatarFallback,
|
Fallback as AvatarFallback,
|
||||||
};
|
};
|
||||||
@ -2,20 +2,21 @@ import { type VariantProps, tv } from "tailwind-variants";
|
|||||||
export { default as Badge } from "./badge.svelte";
|
export { default as Badge } from "./badge.svelte";
|
||||||
|
|
||||||
export const badgeVariants = tv({
|
export const badgeVariants = tv({
|
||||||
base: "inline-flex select-none items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
base: "inline-flex select-none items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
||||||
variants: {
|
variants: {
|
||||||
variant: {
|
variant: {
|
||||||
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
default:
|
||||||
secondary:
|
"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
||||||
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
secondary:
|
||||||
destructive:
|
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
||||||
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
destructive:
|
||||||
outline: "text-foreground",
|
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
||||||
},
|
outline: "text-foreground",
|
||||||
},
|
},
|
||||||
defaultVariants: {
|
},
|
||||||
variant: "default",
|
defaultVariants: {
|
||||||
},
|
variant: "default",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export type Variant = VariantProps<typeof badgeVariants>["variant"];
|
export type Variant = VariantProps<typeof badgeVariants>["variant"];
|
||||||
@ -13,18 +13,18 @@ import NextButton from "./calendar-next-button.svelte";
|
|||||||
import PrevButton from "./calendar-prev-button.svelte";
|
import PrevButton from "./calendar-prev-button.svelte";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Day,
|
Day,
|
||||||
Cell,
|
Cell,
|
||||||
Grid,
|
Grid,
|
||||||
Header,
|
Header,
|
||||||
Months,
|
Months,
|
||||||
GridRow,
|
GridRow,
|
||||||
Heading,
|
Heading,
|
||||||
GridBody,
|
GridBody,
|
||||||
GridHead,
|
GridHead,
|
||||||
HeadCell,
|
HeadCell,
|
||||||
NextButton,
|
NextButton,
|
||||||
PrevButton,
|
PrevButton,
|
||||||
//
|
//
|
||||||
Root as Calendar,
|
Root as Calendar,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -6,19 +6,19 @@ import Header from "./card-header.svelte";
|
|||||||
import Title from "./card-title.svelte";
|
import Title from "./card-title.svelte";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Root,
|
Root,
|
||||||
Content,
|
Content,
|
||||||
Description,
|
Description,
|
||||||
Footer,
|
Footer,
|
||||||
Header,
|
Header,
|
||||||
Title,
|
Title,
|
||||||
//
|
//
|
||||||
Root as Card,
|
Root as Card,
|
||||||
Content as CardContent,
|
Content as CardContent,
|
||||||
Description as CardDescription,
|
Description as CardDescription,
|
||||||
Footer as CardFooter,
|
Footer as CardFooter,
|
||||||
Header as CardHeader,
|
Header as CardHeader,
|
||||||
Title as CardTitle,
|
Title as CardTitle,
|
||||||
};
|
};
|
||||||
|
|
||||||
export type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
export type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
||||||
@ -13,25 +13,25 @@ import Shortcut from "./command-shortcut.svelte";
|
|||||||
const Loading = CommandPrimitive.Loading;
|
const Loading = CommandPrimitive.Loading;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Root,
|
Root,
|
||||||
Dialog,
|
Dialog,
|
||||||
Empty,
|
Empty,
|
||||||
Group,
|
Group,
|
||||||
Item,
|
Item,
|
||||||
Input,
|
Input,
|
||||||
List,
|
List,
|
||||||
Separator,
|
Separator,
|
||||||
Shortcut,
|
Shortcut,
|
||||||
Loading,
|
Loading,
|
||||||
//
|
//
|
||||||
Root as Command,
|
Root as Command,
|
||||||
Dialog as CommandDialog,
|
Dialog as CommandDialog,
|
||||||
Empty as CommandEmpty,
|
Empty as CommandEmpty,
|
||||||
Group as CommandGroup,
|
Group as CommandGroup,
|
||||||
Item as CommandItem,
|
Item as CommandItem,
|
||||||
Input as CommandInput,
|
Input as CommandInput,
|
||||||
List as CommandList,
|
List as CommandList,
|
||||||
Separator as CommandSeparator,
|
Separator as CommandSeparator,
|
||||||
Shortcut as CommandShortcut,
|
Shortcut as CommandShortcut,
|
||||||
Loading as CommandLoading,
|
Loading as CommandLoading,
|
||||||
};
|
};
|
||||||
@ -13,25 +13,25 @@ const Trigger = DialogPrimitive.Trigger;
|
|||||||
const Close = DialogPrimitive.Close;
|
const Close = DialogPrimitive.Close;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Root,
|
Root,
|
||||||
Title,
|
Title,
|
||||||
Portal,
|
Portal,
|
||||||
Footer,
|
Footer,
|
||||||
Header,
|
Header,
|
||||||
Trigger,
|
Trigger,
|
||||||
Overlay,
|
Overlay,
|
||||||
Content,
|
Content,
|
||||||
Description,
|
Description,
|
||||||
Close,
|
Close,
|
||||||
//
|
//
|
||||||
Root as Dialog,
|
Root as Dialog,
|
||||||
Title as DialogTitle,
|
Title as DialogTitle,
|
||||||
Portal as DialogPortal,
|
Portal as DialogPortal,
|
||||||
Footer as DialogFooter,
|
Footer as DialogFooter,
|
||||||
Header as DialogHeader,
|
Header as DialogHeader,
|
||||||
Trigger as DialogTrigger,
|
Trigger as DialogTrigger,
|
||||||
Overlay as DialogOverlay,
|
Overlay as DialogOverlay,
|
||||||
Content as DialogContent,
|
Content as DialogContent,
|
||||||
Description as DialogDescription,
|
Description as DialogDescription,
|
||||||
Close as DialogClose,
|
Close as DialogClose,
|
||||||
};
|
};
|
||||||
@ -16,33 +16,33 @@ const Trigger = DropdownMenuPrimitive.Trigger;
|
|||||||
const Group = DropdownMenuPrimitive.Group;
|
const Group = DropdownMenuPrimitive.Group;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Sub,
|
Sub,
|
||||||
Root,
|
Root,
|
||||||
Item,
|
Item,
|
||||||
Label,
|
Label,
|
||||||
Group,
|
Group,
|
||||||
Trigger,
|
Trigger,
|
||||||
Content,
|
Content,
|
||||||
Shortcut,
|
Shortcut,
|
||||||
Separator,
|
Separator,
|
||||||
RadioItem,
|
RadioItem,
|
||||||
SubContent,
|
SubContent,
|
||||||
SubTrigger,
|
SubTrigger,
|
||||||
RadioGroup,
|
RadioGroup,
|
||||||
CheckboxItem,
|
CheckboxItem,
|
||||||
//
|
//
|
||||||
Root as DropdownMenu,
|
Root as DropdownMenu,
|
||||||
Sub as DropdownMenuSub,
|
Sub as DropdownMenuSub,
|
||||||
Item as DropdownMenuItem,
|
Item as DropdownMenuItem,
|
||||||
Label as DropdownMenuLabel,
|
Label as DropdownMenuLabel,
|
||||||
Group as DropdownMenuGroup,
|
Group as DropdownMenuGroup,
|
||||||
Content as DropdownMenuContent,
|
Content as DropdownMenuContent,
|
||||||
Trigger as DropdownMenuTrigger,
|
Trigger as DropdownMenuTrigger,
|
||||||
Shortcut as DropdownMenuShortcut,
|
Shortcut as DropdownMenuShortcut,
|
||||||
RadioItem as DropdownMenuRadioItem,
|
RadioItem as DropdownMenuRadioItem,
|
||||||
Separator as DropdownMenuSeparator,
|
Separator as DropdownMenuSeparator,
|
||||||
RadioGroup as DropdownMenuRadioGroup,
|
RadioGroup as DropdownMenuRadioGroup,
|
||||||
SubContent as DropdownMenuSubContent,
|
SubContent as DropdownMenuSubContent,
|
||||||
SubTrigger as DropdownMenuSubTrigger,
|
SubTrigger as DropdownMenuSubTrigger,
|
||||||
CheckboxItem as DropdownMenuCheckboxItem,
|
CheckboxItem as DropdownMenuCheckboxItem,
|
||||||
};
|
};
|
||||||
@ -1,29 +1,29 @@
|
|||||||
import Root from "./input.svelte";
|
import Root from "./input.svelte";
|
||||||
|
|
||||||
export type FormInputEvent<T extends Event = Event> = T & {
|
export type FormInputEvent<T extends Event = Event> = T & {
|
||||||
currentTarget: EventTarget & HTMLInputElement;
|
currentTarget: EventTarget & HTMLInputElement;
|
||||||
};
|
};
|
||||||
export type InputEvents = {
|
export type InputEvents = {
|
||||||
blur: FormInputEvent<FocusEvent>;
|
blur: FormInputEvent<FocusEvent>;
|
||||||
change: FormInputEvent<Event>;
|
change: FormInputEvent<Event>;
|
||||||
click: FormInputEvent<MouseEvent>;
|
click: FormInputEvent<MouseEvent>;
|
||||||
focus: FormInputEvent<FocusEvent>;
|
focus: FormInputEvent<FocusEvent>;
|
||||||
focusin: FormInputEvent<FocusEvent>;
|
focusin: FormInputEvent<FocusEvent>;
|
||||||
focusout: FormInputEvent<FocusEvent>;
|
focusout: FormInputEvent<FocusEvent>;
|
||||||
keydown: FormInputEvent<KeyboardEvent>;
|
keydown: FormInputEvent<KeyboardEvent>;
|
||||||
keypress: FormInputEvent<KeyboardEvent>;
|
keypress: FormInputEvent<KeyboardEvent>;
|
||||||
keyup: FormInputEvent<KeyboardEvent>;
|
keyup: FormInputEvent<KeyboardEvent>;
|
||||||
mouseover: FormInputEvent<MouseEvent>;
|
mouseover: FormInputEvent<MouseEvent>;
|
||||||
mouseenter: FormInputEvent<MouseEvent>;
|
mouseenter: FormInputEvent<MouseEvent>;
|
||||||
mouseleave: FormInputEvent<MouseEvent>;
|
mouseleave: FormInputEvent<MouseEvent>;
|
||||||
mousemove: FormInputEvent<MouseEvent>;
|
mousemove: FormInputEvent<MouseEvent>;
|
||||||
paste: FormInputEvent<ClipboardEvent>;
|
paste: FormInputEvent<ClipboardEvent>;
|
||||||
input: FormInputEvent<InputEvent>;
|
input: FormInputEvent<InputEvent>;
|
||||||
wheel: FormInputEvent<WheelEvent>;
|
wheel: FormInputEvent<WheelEvent>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Root,
|
Root,
|
||||||
//
|
//
|
||||||
Root as Input,
|
Root as Input,
|
||||||
};
|
};
|
||||||
@ -5,13 +5,13 @@ const Trigger = PopoverPrimitive.Trigger;
|
|||||||
const Close = PopoverPrimitive.Close;
|
const Close = PopoverPrimitive.Close;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Root,
|
Root,
|
||||||
Content,
|
Content,
|
||||||
Trigger,
|
Trigger,
|
||||||
Close,
|
Close,
|
||||||
//
|
//
|
||||||
Root as Popover,
|
Root as Popover,
|
||||||
Content as PopoverContent,
|
Content as PopoverContent,
|
||||||
Trigger as PopoverTrigger,
|
Trigger as PopoverTrigger,
|
||||||
Close as PopoverClose,
|
Close as PopoverClose,
|
||||||
};
|
};
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import Root from "./progress.svelte";
|
import Root from "./progress.svelte";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Root,
|
Root,
|
||||||
//
|
//
|
||||||
Root as Progress,
|
Root as Progress,
|
||||||
};
|
};
|
||||||
@ -12,23 +12,23 @@ const Input = SelectPrimitive.Input;
|
|||||||
const Value = SelectPrimitive.Value;
|
const Value = SelectPrimitive.Value;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Root,
|
Root,
|
||||||
Group,
|
Group,
|
||||||
Input,
|
Input,
|
||||||
Label,
|
Label,
|
||||||
Item,
|
Item,
|
||||||
Value,
|
Value,
|
||||||
Content,
|
Content,
|
||||||
Trigger,
|
Trigger,
|
||||||
Separator,
|
Separator,
|
||||||
//
|
//
|
||||||
Root as Select,
|
Root as Select,
|
||||||
Group as SelectGroup,
|
Group as SelectGroup,
|
||||||
Input as SelectInput,
|
Input as SelectInput,
|
||||||
Label as SelectLabel,
|
Label as SelectLabel,
|
||||||
Item as SelectItem,
|
Item as SelectItem,
|
||||||
Value as SelectValue,
|
Value as SelectValue,
|
||||||
Content as SelectContent,
|
Content as SelectContent,
|
||||||
Trigger as SelectTrigger,
|
Trigger as SelectTrigger,
|
||||||
Separator as SelectSeparator,
|
Separator as SelectSeparator,
|
||||||
};
|
};
|
||||||
@ -14,93 +14,93 @@ const Close = SheetPrimitive.Close;
|
|||||||
const Trigger = SheetPrimitive.Trigger;
|
const Trigger = SheetPrimitive.Trigger;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Root,
|
Root,
|
||||||
Close,
|
Close,
|
||||||
Trigger,
|
Trigger,
|
||||||
Portal,
|
Portal,
|
||||||
Overlay,
|
Overlay,
|
||||||
Content,
|
Content,
|
||||||
Header,
|
Header,
|
||||||
Footer,
|
Footer,
|
||||||
Title,
|
Title,
|
||||||
Description,
|
Description,
|
||||||
//
|
//
|
||||||
Root as Sheet,
|
Root as Sheet,
|
||||||
Close as SheetClose,
|
Close as SheetClose,
|
||||||
Trigger as SheetTrigger,
|
Trigger as SheetTrigger,
|
||||||
Portal as SheetPortal,
|
Portal as SheetPortal,
|
||||||
Overlay as SheetOverlay,
|
Overlay as SheetOverlay,
|
||||||
Content as SheetContent,
|
Content as SheetContent,
|
||||||
Header as SheetHeader,
|
Header as SheetHeader,
|
||||||
Footer as SheetFooter,
|
Footer as SheetFooter,
|
||||||
Title as SheetTitle,
|
Title as SheetTitle,
|
||||||
Description as SheetDescription,
|
Description as SheetDescription,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const sheetVariants = tv({
|
export const sheetVariants = tv({
|
||||||
base: "fixed z-50 gap-4 bg-background p-6 shadow-lg",
|
base: "fixed z-50 gap-4 bg-background p-6 shadow-lg",
|
||||||
variants: {
|
variants: {
|
||||||
side: {
|
side: {
|
||||||
top: "inset-x-0 top-0 border-b",
|
top: "inset-x-0 top-0 border-b",
|
||||||
bottom: "inset-x-0 bottom-0 border-t",
|
bottom: "inset-x-0 bottom-0 border-t",
|
||||||
left: "inset-y-0 left-0 h-full w-3/4 sm:max-w-sm",
|
left: "inset-y-0 left-0 h-full w-3/4 sm:max-w-sm",
|
||||||
right: "inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
|
right: "inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
defaultVariants: {
|
defaultVariants: {
|
||||||
side: "right",
|
side: "right",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const sheetTransitions = {
|
export const sheetTransitions = {
|
||||||
top: {
|
top: {
|
||||||
in: {
|
in: {
|
||||||
y: "-100%",
|
y: "-100%",
|
||||||
duration: 100,
|
duration: 100,
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
},
|
},
|
||||||
out: {
|
out: {
|
||||||
y: "-100%",
|
y: "-100%",
|
||||||
duration: 100,
|
duration: 100,
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
bottom: {
|
bottom: {
|
||||||
in: {
|
in: {
|
||||||
y: "100%",
|
y: "100%",
|
||||||
duration: 100,
|
duration: 100,
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
},
|
},
|
||||||
out: {
|
out: {
|
||||||
y: "100%",
|
y: "100%",
|
||||||
duration: 100,
|
duration: 100,
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
left: {
|
left: {
|
||||||
in: {
|
in: {
|
||||||
x: "-100%",
|
x: "-100%",
|
||||||
duration: 100,
|
duration: 100,
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
},
|
},
|
||||||
out: {
|
out: {
|
||||||
x: "-100%",
|
x: "-100%",
|
||||||
duration: 100,
|
duration: 100,
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
right: {
|
right: {
|
||||||
in: {
|
in: {
|
||||||
x: "100%",
|
x: "100%",
|
||||||
duration: 100,
|
duration: 100,
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
},
|
},
|
||||||
out: {
|
out: {
|
||||||
x: "100%",
|
x: "100%",
|
||||||
duration: 100,
|
duration: 100,
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Side = VariantProps<typeof sheetVariants>["side"];
|
export type Side = VariantProps<typeof sheetVariants>["side"];
|
||||||
@ -8,21 +8,21 @@ import Header from "./table-header.svelte";
|
|||||||
import Row from "./table-row.svelte";
|
import Row from "./table-row.svelte";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Root,
|
Root,
|
||||||
Body,
|
Body,
|
||||||
Caption,
|
Caption,
|
||||||
Cell,
|
Cell,
|
||||||
Footer,
|
Footer,
|
||||||
Head,
|
Head,
|
||||||
Header,
|
Header,
|
||||||
Row,
|
Row,
|
||||||
//
|
//
|
||||||
Root as Table,
|
Root as Table,
|
||||||
Body as TableBody,
|
Body as TableBody,
|
||||||
Caption as TableCaption,
|
Caption as TableCaption,
|
||||||
Cell as TableCell,
|
Cell as TableCell,
|
||||||
Footer as TableFooter,
|
Footer as TableFooter,
|
||||||
Head as TableHead,
|
Head as TableHead,
|
||||||
Header as TableHeader,
|
Header as TableHeader,
|
||||||
Row as TableRow,
|
Row as TableRow,
|
||||||
};
|
};
|
||||||
@ -6,13 +6,13 @@ import Trigger from "./tabs-trigger.svelte";
|
|||||||
const Root = TabsPrimitive.Root;
|
const Root = TabsPrimitive.Root;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Root,
|
Root,
|
||||||
Content,
|
Content,
|
||||||
List,
|
List,
|
||||||
Trigger,
|
Trigger,
|
||||||
//
|
//
|
||||||
Root as Tabs,
|
Root as Tabs,
|
||||||
Content as TabsContent,
|
Content as TabsContent,
|
||||||
List as TabsList,
|
List as TabsList,
|
||||||
Trigger as TabsTrigger,
|
Trigger as TabsTrigger,
|
||||||
};
|
};
|
||||||
@ -5,11 +5,11 @@ const Root = TooltipPrimitive.Root;
|
|||||||
const Trigger = TooltipPrimitive.Trigger;
|
const Trigger = TooltipPrimitive.Trigger;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Root,
|
Root,
|
||||||
Trigger,
|
Trigger,
|
||||||
Content,
|
Content,
|
||||||
//
|
//
|
||||||
Root as Tooltip,
|
Root as Tooltip,
|
||||||
Content as TooltipContent,
|
Content as TooltipContent,
|
||||||
Trigger as TooltipTrigger,
|
Trigger as TooltipTrigger,
|
||||||
};
|
};
|
||||||
File diff suppressed because one or more lines are too long
363
src/lib/dist/tinymce/icons/default/icons.min.js
vendored
363
src/lib/dist/tinymce/icons/default/icons.min.js
vendored
File diff suppressed because one or more lines are too long
6275
src/lib/dist/tinymce/models/dom/model.min.js
vendored
6275
src/lib/dist/tinymce/models/dom/model.min.js
vendored
File diff suppressed because one or more lines are too long
159
src/lib/dist/tinymce/plugins/anchor/plugin.min.js
vendored
159
src/lib/dist/tinymce/plugins/anchor/plugin.min.js
vendored
@ -1,4 +1,161 @@
|
|||||||
/**
|
/**
|
||||||
* TinyMCE version 6.7.0 (2023-08-30)
|
* TinyMCE version 6.7.0 (2023-08-30)
|
||||||
*/
|
*/
|
||||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=("allow_html_in_named_anchor",e=>e.options.get("allow_html_in_named_anchor"));const a="a:not([href])",r=e=>!e,i=e=>e.getAttribute("id")||e.getAttribute("name")||"",l=e=>(e=>"a"===e.nodeName.toLowerCase())(e)&&!e.getAttribute("href")&&""!==i(e),s=e=>e.dom.getParent(e.selection.getStart(),a),d=(e,a)=>{const r=s(e);r?((e,t,o)=>{o.removeAttribute("name"),o.id=t,e.addVisual(),e.undoManager.add()})(e,a,r):((e,a)=>{e.undoManager.transact((()=>{n(e)||e.selection.collapse(!0),e.selection.isCollapsed()?e.insertContent(e.dom.createHTML("a",{id:a})):((e=>{const n=e.dom;t(n).walk(e.selection.getRng(),(e=>{o.each(e,(e=>{var t;l(t=e)&&!t.firstChild&&n.remove(e,!1)}))}))})(e),e.formatter.remove("namedAnchor",void 0,void 0,!0),e.formatter.apply("namedAnchor",{value:a}),e.addVisual())}))})(e,a),e.focus()},c=e=>(e=>r(e.attr("href"))&&!r(e.attr("id")||e.attr("name")))(e)&&!e.firstChild,m=e=>t=>{for(let o=0;o<t.length;o++){const n=t[o];c(n)&&n.attr("contenteditable",e)}},u=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}};e.add("anchor",(e=>{(e=>{(0,e.options.register)("allow_html_in_named_anchor",{processor:"boolean",default:!1})})(e),(e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("a",m("false")),e.serializer.addNodeFilter("a",m(null))}))})(e),(e=>{e.addCommand("mceAnchor",(()=>{(e=>{const t=(e=>{const t=s(e);return t?i(t):""})(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:t=>{((e,t)=>/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)?(d(e,t),!0):(e.windowManager.alert("ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1))(e,t.getData().id)&&t.close()}})})(e)}))})(e),(e=>{const t=()=>e.execCommand("mceAnchor");e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:t,onSetup:t=>{const o=e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind,n=u(e)(t);return()=>{o(),n()}}}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:t,onSetup:u(e)})})(e),e.on("PreInit",(()=>{(e=>{e.formatter.register("namedAnchor",{inline:"a",selector:a,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:(e,t,o)=>l(e)})})(e)}))}))}();
|
!(function () {
|
||||||
|
"use strict";
|
||||||
|
var e = tinymce.util.Tools.resolve("tinymce.PluginManager"),
|
||||||
|
t = tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),
|
||||||
|
o = tinymce.util.Tools.resolve("tinymce.util.Tools");
|
||||||
|
const n =
|
||||||
|
("allow_html_in_named_anchor",
|
||||||
|
(e) => e.options.get("allow_html_in_named_anchor"));
|
||||||
|
const a = "a:not([href])",
|
||||||
|
r = (e) => !e,
|
||||||
|
i = (e) => e.getAttribute("id") || e.getAttribute("name") || "",
|
||||||
|
l = (e) =>
|
||||||
|
((e) => "a" === e.nodeName.toLowerCase())(e) &&
|
||||||
|
!e.getAttribute("href") &&
|
||||||
|
"" !== i(e),
|
||||||
|
s = (e) => e.dom.getParent(e.selection.getStart(), a),
|
||||||
|
d = (e, a) => {
|
||||||
|
const r = s(e);
|
||||||
|
r
|
||||||
|
? ((e, t, o) => {
|
||||||
|
o.removeAttribute("name"),
|
||||||
|
(o.id = t),
|
||||||
|
e.addVisual(),
|
||||||
|
e.undoManager.add();
|
||||||
|
})(e, a, r)
|
||||||
|
: ((e, a) => {
|
||||||
|
e.undoManager.transact(() => {
|
||||||
|
n(e) || e.selection.collapse(!0),
|
||||||
|
e.selection.isCollapsed()
|
||||||
|
? e.insertContent(e.dom.createHTML("a", { id: a }))
|
||||||
|
: (((e) => {
|
||||||
|
const n = e.dom;
|
||||||
|
t(n).walk(e.selection.getRng(), (e) => {
|
||||||
|
o.each(e, (e) => {
|
||||||
|
var t;
|
||||||
|
l((t = e)) && !t.firstChild && n.remove(e, !1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})(e),
|
||||||
|
e.formatter.remove("namedAnchor", void 0, void 0, !0),
|
||||||
|
e.formatter.apply("namedAnchor", { value: a }),
|
||||||
|
e.addVisual());
|
||||||
|
});
|
||||||
|
})(e, a),
|
||||||
|
e.focus();
|
||||||
|
},
|
||||||
|
c = (e) =>
|
||||||
|
((e) => r(e.attr("href")) && !r(e.attr("id") || e.attr("name")))(e) &&
|
||||||
|
!e.firstChild,
|
||||||
|
m = (e) => (t) => {
|
||||||
|
for (let o = 0; o < t.length; o++) {
|
||||||
|
const n = t[o];
|
||||||
|
c(n) && n.attr("contenteditable", e);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
u = (e) => (t) => {
|
||||||
|
const o = () => {
|
||||||
|
t.setEnabled(e.selection.isEditable());
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
e.on("NodeChange", o),
|
||||||
|
o(),
|
||||||
|
() => {
|
||||||
|
e.off("NodeChange", o);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
e.add("anchor", (e) => {
|
||||||
|
((e) => {
|
||||||
|
(0, e.options.register)("allow_html_in_named_anchor", {
|
||||||
|
processor: "boolean",
|
||||||
|
default: !1,
|
||||||
|
});
|
||||||
|
})(e),
|
||||||
|
((e) => {
|
||||||
|
e.on("PreInit", () => {
|
||||||
|
e.parser.addNodeFilter("a", m("false")),
|
||||||
|
e.serializer.addNodeFilter("a", m(null));
|
||||||
|
});
|
||||||
|
})(e),
|
||||||
|
((e) => {
|
||||||
|
e.addCommand("mceAnchor", () => {
|
||||||
|
((e) => {
|
||||||
|
const t = ((e) => {
|
||||||
|
const t = s(e);
|
||||||
|
return t ? i(t) : "";
|
||||||
|
})(e);
|
||||||
|
e.windowManager.open({
|
||||||
|
title: "Anchor",
|
||||||
|
size: "normal",
|
||||||
|
body: {
|
||||||
|
type: "panel",
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
name: "id",
|
||||||
|
type: "input",
|
||||||
|
label: "ID",
|
||||||
|
placeholder: "example",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
buttons: [
|
||||||
|
{ type: "cancel", name: "cancel", text: "Cancel" },
|
||||||
|
{ type: "submit", name: "save", text: "Save", primary: !0 },
|
||||||
|
],
|
||||||
|
initialData: { id: t },
|
||||||
|
onSubmit: (t) => {
|
||||||
|
((e, t) =>
|
||||||
|
/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)
|
||||||
|
? (d(e, t), !0)
|
||||||
|
: (e.windowManager.alert(
|
||||||
|
"ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.",
|
||||||
|
),
|
||||||
|
!1))(e, t.getData().id) && t.close();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
})(e);
|
||||||
|
});
|
||||||
|
})(e),
|
||||||
|
((e) => {
|
||||||
|
const t = () => e.execCommand("mceAnchor");
|
||||||
|
e.ui.registry.addToggleButton("anchor", {
|
||||||
|
icon: "bookmark",
|
||||||
|
tooltip: "Anchor",
|
||||||
|
onAction: t,
|
||||||
|
onSetup: (t) => {
|
||||||
|
const o = e.selection.selectorChangedWithUnbind(
|
||||||
|
"a:not([href])",
|
||||||
|
t.setActive,
|
||||||
|
).unbind,
|
||||||
|
n = u(e)(t);
|
||||||
|
return () => {
|
||||||
|
o(), n();
|
||||||
|
};
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
e.ui.registry.addMenuItem("anchor", {
|
||||||
|
icon: "bookmark",
|
||||||
|
text: "Anchor...",
|
||||||
|
onAction: t,
|
||||||
|
onSetup: u(e),
|
||||||
|
});
|
||||||
|
})(e),
|
||||||
|
e.on("PreInit", () => {
|
||||||
|
((e) => {
|
||||||
|
e.formatter.register("namedAnchor", {
|
||||||
|
inline: "a",
|
||||||
|
selector: a,
|
||||||
|
remove: "all",
|
||||||
|
split: !0,
|
||||||
|
deep: !0,
|
||||||
|
attributes: { id: "%value" },
|
||||||
|
onmatch: (e, t, o) => l(e),
|
||||||
|
});
|
||||||
|
})(e);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|||||||
172
src/lib/dist/tinymce/plugins/autolink/plugin.min.js
vendored
172
src/lib/dist/tinymce/plugins/autolink/plugin.min.js
vendored
@ -1,4 +1,174 @@
|
|||||||
/**
|
/**
|
||||||
* TinyMCE version 6.7.0 (2023-08-30)
|
* TinyMCE version 6.7.0 (2023-08-30)
|
||||||
*/
|
*/
|
||||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),n=t("autolink_pattern"),o=t("link_default_target"),r=t("link_default_protocol"),a=t("allow_unsafe_link_target"),s=("string",e=>"string"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||(null===(a=o.constructor)||void 0===a?void 0:a.name)===r.name)?"string":t;var n,o,r,a})(e));const l=(void 0,e=>undefined===e);const i=e=>!(e=>null==e)(e),c=Object.hasOwnProperty,d=e=>"\ufeff"===e;var u=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker");const f=e=>/^[(\[{ \u00a0]$/.test(e),g=(e,t,n)=>{for(let o=t-1;o>=0;o--){const t=e.charAt(o);if(!d(t)&&n(t))return o}return-1},m=(e,t)=>{var o;const a=e.schema.getVoidElements(),s=n(e),{dom:i,selection:d}=e;if(null!==i.getParent(d.getNode(),"a[href]"))return null;const m=d.getRng(),k=u(i,(e=>{return i.isBlock(e)||(t=a,n=e.nodeName.toLowerCase(),c.call(t,n))||"false"===i.getContentEditable(e);var t,n})),{container:p,offset:y}=((e,t)=>{let n=e,o=t;for(;1===n.nodeType&&n.childNodes[o];)n=n.childNodes[o],o=3===n.nodeType?n.data.length:n.childNodes.length;return{container:n,offset:o}})(m.endContainer,m.endOffset),w=null!==(o=i.getParent(p,i.isBlock))&&void 0!==o?o:i.getRoot(),h=k.backwards(p,y+t,((e,t)=>{const n=e.data,o=g(n,t,(r=f,e=>!r(e)));var r,a;return-1===o||(a=n[o],/[?!,.;:]/.test(a))?o:o+1}),w);if(!h)return null;let v=h.container;const _=k.backwards(h.container,h.offset,((e,t)=>{v=e;const n=g(e.data,t,f);return-1===n?n:n+1}),w),A=i.createRng();_?A.setStart(_.container,_.offset):A.setStart(v,0),A.setEnd(h.container,h.offset);const C=A.toString().replace(/\uFEFF/g,"").match(s);if(C){let t=C[0];return $="www.",(b=t).length>=4&&b.substr(0,4)===$?t=r(e)+"://"+t:((e,t,n=0,o)=>{const r=e.indexOf(t,n);return-1!==r&&(!!l(o)||r+t.length<=o)})(t,"@")&&!(e=>/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(e))(t)&&(t="mailto:"+t),{rng:A,url:t}}var b,$;return null},k=(e,t)=>{const{dom:n,selection:r}=e,{rng:l,url:i}=t,c=r.getBookmark();r.setRng(l);const d="createlink",u={command:d,ui:!1,value:i};if(!e.dispatch("BeforeExecCommand",u).isDefaultPrevented()){e.getDoc().execCommand(d,!1,i),e.dispatch("ExecCommand",u);const t=o(e);if(s(t)){const o=r.getNode();n.setAttrib(o,"target",t),"_blank"!==t||a(e)||n.setAttrib(o,"rel","noopener")}}r.moveToBookmark(c),e.nodeChanged()},p=e=>{const t=m(e,-1);i(t)&&k(e,t)},y=p;e.add("autolink",(e=>{(e=>{const t=e.options.register;t("autolink_pattern",{processor:"regexp",default:new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i")}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"})})(e),(e=>{e.on("keydown",(t=>{13!==t.keyCode||t.isDefaultPrevented()||(e=>{const t=m(e,0);i(t)&&k(e,t)})(e)})),e.on("keyup",(t=>{32===t.keyCode?p(e):(48===t.keyCode&&t.shiftKey||221===t.keyCode)&&y(e)}))})(e)}))}();
|
!(function () {
|
||||||
|
"use strict";
|
||||||
|
var e = tinymce.util.Tools.resolve("tinymce.PluginManager");
|
||||||
|
const t = (e) => (t) => t.options.get(e),
|
||||||
|
n = t("autolink_pattern"),
|
||||||
|
o = t("link_default_target"),
|
||||||
|
r = t("link_default_protocol"),
|
||||||
|
a = t("allow_unsafe_link_target"),
|
||||||
|
s =
|
||||||
|
("string",
|
||||||
|
(e) =>
|
||||||
|
"string" ===
|
||||||
|
((e) => {
|
||||||
|
const t = typeof e;
|
||||||
|
return null === e
|
||||||
|
? "null"
|
||||||
|
: "object" === t && Array.isArray(e)
|
||||||
|
? "array"
|
||||||
|
: "object" === t &&
|
||||||
|
((n = o = e),
|
||||||
|
(r = String).prototype.isPrototypeOf(n) ||
|
||||||
|
(null === (a = o.constructor) || void 0 === a
|
||||||
|
? void 0
|
||||||
|
: a.name) === r.name)
|
||||||
|
? "string"
|
||||||
|
: t;
|
||||||
|
var n, o, r, a;
|
||||||
|
})(e));
|
||||||
|
const l = (void 0, (e) => undefined === e);
|
||||||
|
const i = (e) => !((e) => null == e)(e),
|
||||||
|
c = Object.hasOwnProperty,
|
||||||
|
d = (e) => "\ufeff" === e;
|
||||||
|
var u = tinymce.util.Tools.resolve("tinymce.dom.TextSeeker");
|
||||||
|
const f = (e) => /^[(\[{ \u00a0]$/.test(e),
|
||||||
|
g = (e, t, n) => {
|
||||||
|
for (let o = t - 1; o >= 0; o--) {
|
||||||
|
const t = e.charAt(o);
|
||||||
|
if (!d(t) && n(t)) return o;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
},
|
||||||
|
m = (e, t) => {
|
||||||
|
var o;
|
||||||
|
const a = e.schema.getVoidElements(),
|
||||||
|
s = n(e),
|
||||||
|
{ dom: i, selection: d } = e;
|
||||||
|
if (null !== i.getParent(d.getNode(), "a[href]")) return null;
|
||||||
|
const m = d.getRng(),
|
||||||
|
k = u(i, (e) => {
|
||||||
|
return (
|
||||||
|
i.isBlock(e) ||
|
||||||
|
((t = a), (n = e.nodeName.toLowerCase()), c.call(t, n)) ||
|
||||||
|
"false" === i.getContentEditable(e)
|
||||||
|
);
|
||||||
|
var t, n;
|
||||||
|
}),
|
||||||
|
{ container: p, offset: y } = ((e, t) => {
|
||||||
|
let n = e,
|
||||||
|
o = t;
|
||||||
|
for (; 1 === n.nodeType && n.childNodes[o]; )
|
||||||
|
(n = n.childNodes[o]),
|
||||||
|
(o = 3 === n.nodeType ? n.data.length : n.childNodes.length);
|
||||||
|
return { container: n, offset: o };
|
||||||
|
})(m.endContainer, m.endOffset),
|
||||||
|
w =
|
||||||
|
null !== (o = i.getParent(p, i.isBlock)) && void 0 !== o
|
||||||
|
? o
|
||||||
|
: i.getRoot(),
|
||||||
|
h = k.backwards(
|
||||||
|
p,
|
||||||
|
y + t,
|
||||||
|
(e, t) => {
|
||||||
|
const n = e.data,
|
||||||
|
o = g(n, t, ((r = f), (e) => !r(e)));
|
||||||
|
var r, a;
|
||||||
|
return -1 === o || ((a = n[o]), /[?!,.;:]/.test(a)) ? o : o + 1;
|
||||||
|
},
|
||||||
|
w,
|
||||||
|
);
|
||||||
|
if (!h) return null;
|
||||||
|
let v = h.container;
|
||||||
|
const _ = k.backwards(
|
||||||
|
h.container,
|
||||||
|
h.offset,
|
||||||
|
(e, t) => {
|
||||||
|
v = e;
|
||||||
|
const n = g(e.data, t, f);
|
||||||
|
return -1 === n ? n : n + 1;
|
||||||
|
},
|
||||||
|
w,
|
||||||
|
),
|
||||||
|
A = i.createRng();
|
||||||
|
_ ? A.setStart(_.container, _.offset) : A.setStart(v, 0),
|
||||||
|
A.setEnd(h.container, h.offset);
|
||||||
|
const C = A.toString()
|
||||||
|
.replace(/\uFEFF/g, "")
|
||||||
|
.match(s);
|
||||||
|
if (C) {
|
||||||
|
let t = C[0];
|
||||||
|
return (
|
||||||
|
($ = "www."),
|
||||||
|
(b = t).length >= 4 && b.substr(0, 4) === $
|
||||||
|
? (t = r(e) + "://" + t)
|
||||||
|
: ((e, t, n = 0, o) => {
|
||||||
|
const r = e.indexOf(t, n);
|
||||||
|
return -1 !== r && (!!l(o) || r + t.length <= o);
|
||||||
|
})(t, "@") &&
|
||||||
|
!((e) => /^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(e))(t) &&
|
||||||
|
(t = "mailto:" + t),
|
||||||
|
{ rng: A, url: t }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
var b, $;
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
k = (e, t) => {
|
||||||
|
const { dom: n, selection: r } = e,
|
||||||
|
{ rng: l, url: i } = t,
|
||||||
|
c = r.getBookmark();
|
||||||
|
r.setRng(l);
|
||||||
|
const d = "createlink",
|
||||||
|
u = { command: d, ui: !1, value: i };
|
||||||
|
if (!e.dispatch("BeforeExecCommand", u).isDefaultPrevented()) {
|
||||||
|
e.getDoc().execCommand(d, !1, i), e.dispatch("ExecCommand", u);
|
||||||
|
const t = o(e);
|
||||||
|
if (s(t)) {
|
||||||
|
const o = r.getNode();
|
||||||
|
n.setAttrib(o, "target", t),
|
||||||
|
"_blank" !== t || a(e) || n.setAttrib(o, "rel", "noopener");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
r.moveToBookmark(c), e.nodeChanged();
|
||||||
|
},
|
||||||
|
p = (e) => {
|
||||||
|
const t = m(e, -1);
|
||||||
|
i(t) && k(e, t);
|
||||||
|
},
|
||||||
|
y = p;
|
||||||
|
e.add("autolink", (e) => {
|
||||||
|
((e) => {
|
||||||
|
const t = e.options.register;
|
||||||
|
t("autolink_pattern", {
|
||||||
|
processor: "regexp",
|
||||||
|
default: new RegExp(
|
||||||
|
"^" +
|
||||||
|
/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g
|
||||||
|
.source +
|
||||||
|
"$",
|
||||||
|
"i",
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
t("link_default_target", { processor: "string" }),
|
||||||
|
t("link_default_protocol", { processor: "string", default: "https" });
|
||||||
|
})(e),
|
||||||
|
((e) => {
|
||||||
|
e.on("keydown", (t) => {
|
||||||
|
13 !== t.keyCode ||
|
||||||
|
t.isDefaultPrevented() ||
|
||||||
|
((e) => {
|
||||||
|
const t = m(e, 0);
|
||||||
|
i(t) && k(e, t);
|
||||||
|
})(e);
|
||||||
|
}),
|
||||||
|
e.on("keyup", (t) => {
|
||||||
|
32 === t.keyCode
|
||||||
|
? p(e)
|
||||||
|
: ((48 === t.keyCode && t.shiftKey) || 221 === t.keyCode) && y(e);
|
||||||
|
});
|
||||||
|
})(e);
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|||||||
@ -1,4 +1,138 @@
|
|||||||
/**
|
/**
|
||||||
* TinyMCE version 6.7.0 (2023-08-30)
|
* TinyMCE version 6.7.0 (2023-08-30)
|
||||||
*/
|
*/
|
||||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env");const o=e=>t=>t.options.get(e),s=o("min_height"),i=o("max_height"),n=o("autoresize_overflow_padding"),r=o("autoresize_bottom_margin"),l=(e,t)=>{const o=e.getBody();o&&(o.style.overflowY=t?"":"hidden",t||(o.scrollTop=0))},g=(e,t,o,s)=>{var i;const n=parseInt(null!==(i=e.getStyle(t,o,s))&&void 0!==i?i:"",10);return isNaN(n)?0:n},a=(e,o,r,c)=>{var d;const f=e.dom,u=e.getDoc();if(!u)return;if((e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen())(e))return void l(e,!0);const m=u.documentElement,h=c?c():n(e),p=null!==(d=s(e))&&void 0!==d?d:e.getElement().offsetHeight;let y=p;const S=g(f,m,"margin-top",!0),v=g(f,m,"margin-bottom",!0);let C=m.offsetHeight+S+v+h;C<0&&(C=0);const b=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;C+b>p&&(y=C+b);const w=i(e);if(w&&y>w?(y=w,l(e,!0)):l(e,!1),y!==o.get()){const s=y-o.get();if(f.setStyle(e.getContainer(),"height",y+"px"),o.set(y),(e=>{e.dispatch("ResizeEditor")})(e),t.browser.isSafari()&&(t.os.isMacOS()||t.os.isiOS())){const t=e.getWin();t.scrollTo(t.pageXOffset,t.pageYOffset)}e.hasFocus()&&(e=>{if("setcontent"===(null==e?void 0:e.type.toLowerCase())){const t=e;return!0===t.selection||!0===t.paste}return!1})(r)&&e.selection.scrollIntoView(),(t.browser.isSafari()||t.browser.isChromium())&&s<0&&a(e,o,r,c)}};e.add("autoresize",(e=>{if((e=>{const t=e.options.register;t("autoresize_overflow_padding",{processor:"number",default:1}),t("autoresize_bottom_margin",{processor:"number",default:50})})(e),e.options.isSet("resize")||e.options.set("resize",!1),!e.inline){const o=(e=>{let t=0;return{get:()=>t,set:e=>{t=e}}})();((e,t)=>{e.addCommand("mceAutoResize",(()=>{a(e,t)}))})(e,o),((e,o)=>{let s,i,l=()=>r(e);e.on("init",(i=>{s=0;const r=n(e),g=e.dom;g.setStyles(e.getDoc().documentElement,{height:"auto"}),t.browser.isEdge()||t.browser.isIE()?g.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r,"min-height":0}):g.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r}),a(e,o,i,l),s+=1})),e.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(t=>{if(1===s)i=e.getContainer().offsetHeight,a(e,o,t,l),s+=1;else if(2===s){const t=i<e.getContainer().offsetHeight;if(t){const t=e.dom,o=e.getDoc();t.setStyles(o.documentElement,{"min-height":0}),t.setStyles(e.getBody(),{"min-height":"inherit"})}l=t?(0,()=>0):l,s+=1}else a(e,o,t,l)}))})(e,o)}}))}();
|
!(function () {
|
||||||
|
"use strict";
|
||||||
|
var e = tinymce.util.Tools.resolve("tinymce.PluginManager"),
|
||||||
|
t = tinymce.util.Tools.resolve("tinymce.Env");
|
||||||
|
const o = (e) => (t) => t.options.get(e),
|
||||||
|
s = o("min_height"),
|
||||||
|
i = o("max_height"),
|
||||||
|
n = o("autoresize_overflow_padding"),
|
||||||
|
r = o("autoresize_bottom_margin"),
|
||||||
|
l = (e, t) => {
|
||||||
|
const o = e.getBody();
|
||||||
|
o && ((o.style.overflowY = t ? "" : "hidden"), t || (o.scrollTop = 0));
|
||||||
|
},
|
||||||
|
g = (e, t, o, s) => {
|
||||||
|
var i;
|
||||||
|
const n = parseInt(
|
||||||
|
null !== (i = e.getStyle(t, o, s)) && void 0 !== i ? i : "",
|
||||||
|
10,
|
||||||
|
);
|
||||||
|
return isNaN(n) ? 0 : n;
|
||||||
|
},
|
||||||
|
a = (e, o, r, c) => {
|
||||||
|
var d;
|
||||||
|
const f = e.dom,
|
||||||
|
u = e.getDoc();
|
||||||
|
if (!u) return;
|
||||||
|
if (
|
||||||
|
((e) => e.plugins.fullscreen && e.plugins.fullscreen.isFullscreen())(e)
|
||||||
|
)
|
||||||
|
return void l(e, !0);
|
||||||
|
const m = u.documentElement,
|
||||||
|
h = c ? c() : n(e),
|
||||||
|
p =
|
||||||
|
null !== (d = s(e)) && void 0 !== d ? d : e.getElement().offsetHeight;
|
||||||
|
let y = p;
|
||||||
|
const S = g(f, m, "margin-top", !0),
|
||||||
|
v = g(f, m, "margin-bottom", !0);
|
||||||
|
let C = m.offsetHeight + S + v + h;
|
||||||
|
C < 0 && (C = 0);
|
||||||
|
const b =
|
||||||
|
e.getContainer().offsetHeight -
|
||||||
|
e.getContentAreaContainer().offsetHeight;
|
||||||
|
C + b > p && (y = C + b);
|
||||||
|
const w = i(e);
|
||||||
|
if ((w && y > w ? ((y = w), l(e, !0)) : l(e, !1), y !== o.get())) {
|
||||||
|
const s = y - o.get();
|
||||||
|
if (
|
||||||
|
(f.setStyle(e.getContainer(), "height", y + "px"),
|
||||||
|
o.set(y),
|
||||||
|
((e) => {
|
||||||
|
e.dispatch("ResizeEditor");
|
||||||
|
})(e),
|
||||||
|
t.browser.isSafari() && (t.os.isMacOS() || t.os.isiOS()))
|
||||||
|
) {
|
||||||
|
const t = e.getWin();
|
||||||
|
t.scrollTo(t.pageXOffset, t.pageYOffset);
|
||||||
|
}
|
||||||
|
e.hasFocus() &&
|
||||||
|
((e) => {
|
||||||
|
if ("setcontent" === (null == e ? void 0 : e.type.toLowerCase())) {
|
||||||
|
const t = e;
|
||||||
|
return !0 === t.selection || !0 === t.paste;
|
||||||
|
}
|
||||||
|
return !1;
|
||||||
|
})(r) &&
|
||||||
|
e.selection.scrollIntoView(),
|
||||||
|
(t.browser.isSafari() || t.browser.isChromium()) &&
|
||||||
|
s < 0 &&
|
||||||
|
a(e, o, r, c);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
e.add("autoresize", (e) => {
|
||||||
|
if (
|
||||||
|
(((e) => {
|
||||||
|
const t = e.options.register;
|
||||||
|
t("autoresize_overflow_padding", { processor: "number", default: 1 }),
|
||||||
|
t("autoresize_bottom_margin", { processor: "number", default: 50 });
|
||||||
|
})(e),
|
||||||
|
e.options.isSet("resize") || e.options.set("resize", !1),
|
||||||
|
!e.inline)
|
||||||
|
) {
|
||||||
|
const o = ((e) => {
|
||||||
|
let t = 0;
|
||||||
|
return {
|
||||||
|
get: () => t,
|
||||||
|
set: (e) => {
|
||||||
|
t = e;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
((e, t) => {
|
||||||
|
e.addCommand("mceAutoResize", () => {
|
||||||
|
a(e, t);
|
||||||
|
});
|
||||||
|
})(e, o),
|
||||||
|
((e, o) => {
|
||||||
|
let s,
|
||||||
|
i,
|
||||||
|
l = () => r(e);
|
||||||
|
e.on("init", (i) => {
|
||||||
|
s = 0;
|
||||||
|
const r = n(e),
|
||||||
|
g = e.dom;
|
||||||
|
g.setStyles(e.getDoc().documentElement, { height: "auto" }),
|
||||||
|
t.browser.isEdge() || t.browser.isIE()
|
||||||
|
? g.setStyles(e.getBody(), {
|
||||||
|
paddingLeft: r,
|
||||||
|
paddingRight: r,
|
||||||
|
"min-height": 0,
|
||||||
|
})
|
||||||
|
: g.setStyles(e.getBody(), { paddingLeft: r, paddingRight: r }),
|
||||||
|
a(e, o, i, l),
|
||||||
|
(s += 1);
|
||||||
|
}),
|
||||||
|
e.on(
|
||||||
|
"NodeChange SetContent keyup FullscreenStateChanged ResizeContent",
|
||||||
|
(t) => {
|
||||||
|
if (1 === s)
|
||||||
|
(i = e.getContainer().offsetHeight), a(e, o, t, l), (s += 1);
|
||||||
|
else if (2 === s) {
|
||||||
|
const t = i < e.getContainer().offsetHeight;
|
||||||
|
if (t) {
|
||||||
|
const t = e.dom,
|
||||||
|
o = e.getDoc();
|
||||||
|
t.setStyles(o.documentElement, { "min-height": 0 }),
|
||||||
|
t.setStyles(e.getBody(), { "min-height": "inherit" });
|
||||||
|
}
|
||||||
|
(l = t ? (0, () => 0) : l), (s += 1);
|
||||||
|
} else a(e, o, t, l);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
})(e, o);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|||||||
189
src/lib/dist/tinymce/plugins/autosave/plugin.min.js
vendored
189
src/lib/dist/tinymce/plugins/autosave/plugin.min.js
vendored
@ -1,4 +1,191 @@
|
|||||||
/**
|
/**
|
||||||
* TinyMCE version 6.7.0 (2023-08-30)
|
* TinyMCE version 6.7.0 (2023-08-30)
|
||||||
*/
|
*/
|
||||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=("string",t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(r=o=t,(a=String).prototype.isPrototypeOf(r)||(null===(s=o.constructor)||void 0===s?void 0:s.name)===a.name)?"string":e;var r,o,a,s})(t));const r=(void 0,t=>undefined===t);var o=tinymce.util.Tools.resolve("tinymce.util.Delay"),a=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),s=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=t=>{const e=/^(\d+)([ms]?)$/.exec(t);return(e&&e[2]?{s:1e3,m:6e4}[e[2]]:1)*parseInt(t,10)},i=t=>e=>e.options.get(t),u=i("autosave_ask_before_unload"),l=i("autosave_restore_when_empty"),c=i("autosave_interval"),d=i("autosave_retention"),m=t=>{const e=document.location;return t.options.get("autosave_prefix").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)},v=(t,e)=>{if(r(e))return t.dom.isEmpty(t.getBody());{const r=s.trim(e);if(""===r)return!0;{const e=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(e)}}},f=t=>{var e;const r=parseInt(null!==(e=a.getItem(m(t)+"time"))&&void 0!==e?e:"0",10)||0;return!((new Date).getTime()-r>d(t)&&(p(t,!1),1))},p=(t,e)=>{const r=m(t);a.removeItem(r+"draft"),a.removeItem(r+"time"),!1!==e&&(t=>{t.dispatch("RemoveDraft")})(t)},g=t=>{const e=m(t);!v(t)&&t.isDirty()&&(a.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),a.setItem(e+"time",(new Date).getTime().toString()),(t=>{t.dispatch("StoreDraft")})(t))},y=t=>{var e;const r=m(t);f(t)&&(t.setContent(null!==(e=a.getItem(r+"draft"))&&void 0!==e?e:"",{format:"raw"}),(t=>{t.dispatch("RestoreDraft")})(t))};var D=tinymce.util.Tools.resolve("tinymce.EditorManager");const h=t=>e=>{e.setEnabled(f(t));const r=()=>e.setEnabled(f(t));return t.on("StoreDraft RestoreDraft RemoveDraft",r),()=>t.off("StoreDraft RestoreDraft RemoveDraft",r)};t.add("autosave",(t=>((t=>{const r=t.options.register,o=t=>{const r=e(t);return r?{value:n(t),valid:r}:{valid:!1,message:"Must be a string."}};r("autosave_ask_before_unload",{processor:"boolean",default:!0}),r("autosave_prefix",{processor:"string",default:"tinymce-autosave-{path}{query}{hash}-{id}-"}),r("autosave_restore_when_empty",{processor:"boolean",default:!1}),r("autosave_interval",{processor:o,default:"30s"}),r("autosave_retention",{processor:o,default:"20m"})})(t),(t=>{t.editorManager.on("BeforeUnload",(t=>{let e;s.each(D.get(),(t=>{t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&u(t)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))})),e&&(t.preventDefault(),t.returnValue=e)}))})(t),(t=>{(t=>{const e=c(t);o.setEditorInterval(t,(()=>{g(t)}),e)})(t);const e=()=>{(t=>{t.undoManager.transact((()=>{y(t),p(t)})),t.focus()})(t)};t.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)}),t.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)})})(t),t.on("init",(()=>{l(t)&&t.dom.isEmpty(t.getBody())&&y(t)})),(t=>({hasDraft:()=>f(t),storeDraft:()=>g(t),restoreDraft:()=>y(t),removeDraft:e=>p(t,e),isEmpty:e=>v(t,e)}))(t))))}();
|
!(function () {
|
||||||
|
"use strict";
|
||||||
|
var t = tinymce.util.Tools.resolve("tinymce.PluginManager");
|
||||||
|
const e =
|
||||||
|
("string",
|
||||||
|
(t) =>
|
||||||
|
"string" ===
|
||||||
|
((t) => {
|
||||||
|
const e = typeof t;
|
||||||
|
return null === t
|
||||||
|
? "null"
|
||||||
|
: "object" === e && Array.isArray(t)
|
||||||
|
? "array"
|
||||||
|
: "object" === e &&
|
||||||
|
((r = o = t),
|
||||||
|
(a = String).prototype.isPrototypeOf(r) ||
|
||||||
|
(null === (s = o.constructor) || void 0 === s
|
||||||
|
? void 0
|
||||||
|
: s.name) === a.name)
|
||||||
|
? "string"
|
||||||
|
: e;
|
||||||
|
var r, o, a, s;
|
||||||
|
})(t));
|
||||||
|
const r = (void 0, (t) => undefined === t);
|
||||||
|
var o = tinymce.util.Tools.resolve("tinymce.util.Delay"),
|
||||||
|
a = tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),
|
||||||
|
s = tinymce.util.Tools.resolve("tinymce.util.Tools");
|
||||||
|
const n = (t) => {
|
||||||
|
const e = /^(\d+)([ms]?)$/.exec(t);
|
||||||
|
return (e && e[2] ? { s: 1e3, m: 6e4 }[e[2]] : 1) * parseInt(t, 10);
|
||||||
|
},
|
||||||
|
i = (t) => (e) => e.options.get(t),
|
||||||
|
u = i("autosave_ask_before_unload"),
|
||||||
|
l = i("autosave_restore_when_empty"),
|
||||||
|
c = i("autosave_interval"),
|
||||||
|
d = i("autosave_retention"),
|
||||||
|
m = (t) => {
|
||||||
|
const e = document.location;
|
||||||
|
return t.options
|
||||||
|
.get("autosave_prefix")
|
||||||
|
.replace(/{path}/g, e.pathname)
|
||||||
|
.replace(/{query}/g, e.search)
|
||||||
|
.replace(/{hash}/g, e.hash)
|
||||||
|
.replace(/{id}/g, t.id);
|
||||||
|
},
|
||||||
|
v = (t, e) => {
|
||||||
|
if (r(e)) return t.dom.isEmpty(t.getBody());
|
||||||
|
{
|
||||||
|
const r = s.trim(e);
|
||||||
|
if ("" === r) return !0;
|
||||||
|
{
|
||||||
|
const e = new DOMParser().parseFromString(r, "text/html");
|
||||||
|
return t.dom.isEmpty(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
f = (t) => {
|
||||||
|
var e;
|
||||||
|
const r =
|
||||||
|
parseInt(
|
||||||
|
null !== (e = a.getItem(m(t) + "time")) && void 0 !== e ? e : "0",
|
||||||
|
10,
|
||||||
|
) || 0;
|
||||||
|
return !(new Date().getTime() - r > d(t) && (p(t, !1), 1));
|
||||||
|
},
|
||||||
|
p = (t, e) => {
|
||||||
|
const r = m(t);
|
||||||
|
a.removeItem(r + "draft"),
|
||||||
|
a.removeItem(r + "time"),
|
||||||
|
!1 !== e &&
|
||||||
|
((t) => {
|
||||||
|
t.dispatch("RemoveDraft");
|
||||||
|
})(t);
|
||||||
|
},
|
||||||
|
g = (t) => {
|
||||||
|
const e = m(t);
|
||||||
|
!v(t) &&
|
||||||
|
t.isDirty() &&
|
||||||
|
(a.setItem(e + "draft", t.getContent({ format: "raw", no_events: !0 })),
|
||||||
|
a.setItem(e + "time", new Date().getTime().toString()),
|
||||||
|
((t) => {
|
||||||
|
t.dispatch("StoreDraft");
|
||||||
|
})(t));
|
||||||
|
},
|
||||||
|
y = (t) => {
|
||||||
|
var e;
|
||||||
|
const r = m(t);
|
||||||
|
f(t) &&
|
||||||
|
(t.setContent(
|
||||||
|
null !== (e = a.getItem(r + "draft")) && void 0 !== e ? e : "",
|
||||||
|
{ format: "raw" },
|
||||||
|
),
|
||||||
|
((t) => {
|
||||||
|
t.dispatch("RestoreDraft");
|
||||||
|
})(t));
|
||||||
|
};
|
||||||
|
var D = tinymce.util.Tools.resolve("tinymce.EditorManager");
|
||||||
|
const h = (t) => (e) => {
|
||||||
|
e.setEnabled(f(t));
|
||||||
|
const r = () => e.setEnabled(f(t));
|
||||||
|
return (
|
||||||
|
t.on("StoreDraft RestoreDraft RemoveDraft", r),
|
||||||
|
() => t.off("StoreDraft RestoreDraft RemoveDraft", r)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
t.add(
|
||||||
|
"autosave",
|
||||||
|
(t) => (
|
||||||
|
((t) => {
|
||||||
|
const r = t.options.register,
|
||||||
|
o = (t) => {
|
||||||
|
const r = e(t);
|
||||||
|
return r
|
||||||
|
? { value: n(t), valid: r }
|
||||||
|
: { valid: !1, message: "Must be a string." };
|
||||||
|
};
|
||||||
|
r("autosave_ask_before_unload", { processor: "boolean", default: !0 }),
|
||||||
|
r("autosave_prefix", {
|
||||||
|
processor: "string",
|
||||||
|
default: "tinymce-autosave-{path}{query}{hash}-{id}-",
|
||||||
|
}),
|
||||||
|
r("autosave_restore_when_empty", {
|
||||||
|
processor: "boolean",
|
||||||
|
default: !1,
|
||||||
|
}),
|
||||||
|
r("autosave_interval", { processor: o, default: "30s" }),
|
||||||
|
r("autosave_retention", { processor: o, default: "20m" });
|
||||||
|
})(t),
|
||||||
|
((t) => {
|
||||||
|
t.editorManager.on("BeforeUnload", (t) => {
|
||||||
|
let e;
|
||||||
|
s.each(D.get(), (t) => {
|
||||||
|
t.plugins.autosave && t.plugins.autosave.storeDraft(),
|
||||||
|
!e &&
|
||||||
|
t.isDirty() &&
|
||||||
|
u(t) &&
|
||||||
|
(e = t.translate(
|
||||||
|
"You have unsaved changes are you sure you want to navigate away?",
|
||||||
|
));
|
||||||
|
}),
|
||||||
|
e && (t.preventDefault(), (t.returnValue = e));
|
||||||
|
});
|
||||||
|
})(t),
|
||||||
|
((t) => {
|
||||||
|
((t) => {
|
||||||
|
const e = c(t);
|
||||||
|
o.setEditorInterval(
|
||||||
|
t,
|
||||||
|
() => {
|
||||||
|
g(t);
|
||||||
|
},
|
||||||
|
e,
|
||||||
|
);
|
||||||
|
})(t);
|
||||||
|
const e = () => {
|
||||||
|
((t) => {
|
||||||
|
t.undoManager.transact(() => {
|
||||||
|
y(t), p(t);
|
||||||
|
}),
|
||||||
|
t.focus();
|
||||||
|
})(t);
|
||||||
|
};
|
||||||
|
t.ui.registry.addButton("restoredraft", {
|
||||||
|
tooltip: "Restore last draft",
|
||||||
|
icon: "restore-draft",
|
||||||
|
onAction: e,
|
||||||
|
onSetup: h(t),
|
||||||
|
}),
|
||||||
|
t.ui.registry.addMenuItem("restoredraft", {
|
||||||
|
text: "Restore last draft",
|
||||||
|
icon: "restore-draft",
|
||||||
|
onAction: e,
|
||||||
|
onSetup: h(t),
|
||||||
|
});
|
||||||
|
})(t),
|
||||||
|
t.on("init", () => {
|
||||||
|
l(t) && t.dom.isEmpty(t.getBody()) && y(t);
|
||||||
|
}),
|
||||||
|
((t) => ({
|
||||||
|
hasDraft: () => f(t),
|
||||||
|
storeDraft: () => g(t),
|
||||||
|
restoreDraft: () => y(t),
|
||||||
|
removeDraft: (e) => p(t, e),
|
||||||
|
isEmpty: (e) => v(t, e),
|
||||||
|
}))(t)
|
||||||
|
),
|
||||||
|
);
|
||||||
|
})();
|
||||||
|
|||||||
54
src/lib/dist/tinymce/plugins/code/plugin.min.js
vendored
54
src/lib/dist/tinymce/plugins/code/plugin.min.js
vendored
@ -1,4 +1,56 @@
|
|||||||
/**
|
/**
|
||||||
* TinyMCE version 6.7.0 (2023-08-30)
|
* TinyMCE version 6.7.0 (2023-08-30)
|
||||||
*/
|
*/
|
||||||
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("code",(e=>((e=>{e.addCommand("mceCodeEditor",(()=>{(e=>{const o=(e=>e.getContent({source_view:!0}))(e);e.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:o},onSubmit:o=>{((e,o)=>{e.focus(),e.undoManager.transact((()=>{e.setContent(o)})),e.selection.setCursorLocation(),e.nodeChanged()})(e,o.getData().code),o.close()}})})(e)}))})(e),(e=>{const o=()=>e.execCommand("mceCodeEditor");e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:o}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:o})})(e),{})))}();
|
!(function () {
|
||||||
|
"use strict";
|
||||||
|
tinymce.util.Tools.resolve("tinymce.PluginManager").add(
|
||||||
|
"code",
|
||||||
|
(e) => (
|
||||||
|
((e) => {
|
||||||
|
e.addCommand("mceCodeEditor", () => {
|
||||||
|
((e) => {
|
||||||
|
const o = ((e) => e.getContent({ source_view: !0 }))(e);
|
||||||
|
e.windowManager.open({
|
||||||
|
title: "Source Code",
|
||||||
|
size: "large",
|
||||||
|
body: {
|
||||||
|
type: "panel",
|
||||||
|
items: [{ type: "textarea", name: "code" }],
|
||||||
|
},
|
||||||
|
buttons: [
|
||||||
|
{ type: "cancel", name: "cancel", text: "Cancel" },
|
||||||
|
{ type: "submit", name: "save", text: "Save", primary: !0 },
|
||||||
|
],
|
||||||
|
initialData: { code: o },
|
||||||
|
onSubmit: (o) => {
|
||||||
|
((e, o) => {
|
||||||
|
e.focus(),
|
||||||
|
e.undoManager.transact(() => {
|
||||||
|
e.setContent(o);
|
||||||
|
}),
|
||||||
|
e.selection.setCursorLocation(),
|
||||||
|
e.nodeChanged();
|
||||||
|
})(e, o.getData().code),
|
||||||
|
o.close();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
})(e);
|
||||||
|
});
|
||||||
|
})(e),
|
||||||
|
((e) => {
|
||||||
|
const o = () => e.execCommand("mceCodeEditor");
|
||||||
|
e.ui.registry.addButton("code", {
|
||||||
|
icon: "sourcecode",
|
||||||
|
tooltip: "Source code",
|
||||||
|
onAction: o,
|
||||||
|
}),
|
||||||
|
e.ui.registry.addMenuItem("code", {
|
||||||
|
icon: "sourcecode",
|
||||||
|
text: "Source code",
|
||||||
|
onAction: o,
|
||||||
|
});
|
||||||
|
})(e),
|
||||||
|
{}
|
||||||
|
),
|
||||||
|
);
|
||||||
|
})();
|
||||||
|
|||||||
2272
src/lib/dist/tinymce/plugins/codesample/plugin.min.js
vendored
2272
src/lib/dist/tinymce/plugins/codesample/plugin.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,4 +1,285 @@
|
|||||||
/**
|
/**
|
||||||
* TinyMCE version 6.7.0 (2023-08-30)
|
* TinyMCE version 6.7.0 (2023-08-30)
|
||||||
*/
|
*/
|
||||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>e=>typeof e===t,o=t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(o=r=t,(n=String).prototype.isPrototypeOf(o)||(null===(i=r.constructor)||void 0===i?void 0:i.name)===n.name)?"string":e;var o,r,n,i})(t),r=e("boolean"),n=t=>!(t=>null==t)(t),i=e("function"),s=e("number"),l=(!1,()=>false);class a{constructor(t,e){this.tag=t,this.value=e}static some(t){return new a(!0,t)}static none(){return a.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?a.some(t(this.value)):a.none()}bind(t){return this.tag?t(this.value):a.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:a.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return n(t)?a.some(t):a.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}a.singletonNone=new a(!1);const u=(t,e)=>{for(let o=0,r=t.length;o<r;o++)e(t[o],o)},c=t=>{if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},d=c,h=(t,e)=>{const o=t.dom;if(1!==o.nodeType)return!1;{const t=o;if(void 0!==t.matches)return t.matches(e);if(void 0!==t.msMatchesSelector)return t.msMatchesSelector(e);if(void 0!==t.webkitMatchesSelector)return t.webkitMatchesSelector(e);if(void 0!==t.mozMatchesSelector)return t.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}};"undefined"!=typeof window?window:Function("return this;")();const m=t=>e=>(t=>t.dom.nodeType)(e)===t,g=m(1),f=m(3),v=m(9),y=m(11),p=(t,e)=>{t.dom.removeAttribute(e)},w=i(Element.prototype.attachShadow)&&i(Node.prototype.getRootNode)?t=>d(t.dom.getRootNode()):t=>v(t)?t:d(t.dom.ownerDocument),b=t=>d(t.dom.host),N=t=>{const e=f(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;const o=e.ownerDocument;return(t=>{const e=w(t);return y(o=e)&&n(o.dom.host)?a.some(e):a.none();var o})(d(e)).fold((()=>o.body.contains(e)),(r=N,i=b,t=>r(i(t))));var r,i},S=t=>"rtl"===((t,e)=>{const o=t.dom,r=window.getComputedStyle(o).getPropertyValue(e);return""!==r||N(t)?r:((t,e)=>(t=>void 0!==t.style&&i(t.style.getPropertyValue))(t)?t.style.getPropertyValue(e):"")(o,e)})(t,"direction")?"rtl":"ltr",A=(t,e)=>((t,o)=>((t,e)=>{const o=[];for(let r=0,n=t.length;r<n;r++){const n=t[r];e(n,r)&&o.push(n)}return o})(((t,e)=>{const o=t.length,r=new Array(o);for(let n=0;n<o;n++){const o=t[n];r[n]=e(o,n)}return r})(t.dom.childNodes,d),(t=>h(t,e))))(t),E=("li",t=>g(t)&&"li"===t.dom.nodeName.toLowerCase());const T=(t,e,n)=>{u(e,(e=>{const c=d(e),m=E(c),f=((t,e)=>{return(e?(o=t,r="ol,ul",((t,e,o)=>{let n=t.dom;const s=i(o)?o:l;for(;n.parentNode;){n=n.parentNode;const t=d(n);if(h(t,r))return a.some(t);if(s(t))break}return a.none()})(o,0,n)):a.some(t)).getOr(t);var o,r,n})(c,m);var v;(v=f,(t=>a.from(t.dom.parentNode).map(d))(v).filter(g)).each((e=>{if(t.setStyle(f.dom,"direction",null),S(e)===n?p(f,"dir"):((t,e,n)=>{((t,e,n)=>{if(!(o(n)||r(n)||s(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")})(t.dom,e,n)})(f,"dir",n),S(f)!==n&&t.setStyle(f.dom,"direction",n),m){const e=A(f,"li[dir],li[style]");u(e,(e=>{p(e,"dir"),t.setStyle(e.dom,"direction",null)}))}}))}))},C=(t,e)=>{t.selection.isEditable()&&(T(t.dom,t.selection.getSelectedBlocks(),e),t.nodeChanged())},D=(t,e)=>o=>{const r=r=>{const n=d(r.element);o.setActive(S(n)===e),o.setEnabled(t.selection.isEditable())};return t.on("NodeChange",r),o.setEnabled(t.selection.isEditable()),()=>t.off("NodeChange",r)};t.add("directionality",(t=>{(t=>{t.addCommand("mceDirectionLTR",(()=>{C(t,"ltr")})),t.addCommand("mceDirectionRTL",(()=>{C(t,"rtl")}))})(t),(t=>{t.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:()=>t.execCommand("mceDirectionLTR"),onSetup:D(t,"ltr")}),t.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:()=>t.execCommand("mceDirectionRTL"),onSetup:D(t,"rtl")})})(t)}))}();
|
!(function () {
|
||||||
|
"use strict";
|
||||||
|
var t = tinymce.util.Tools.resolve("tinymce.PluginManager");
|
||||||
|
const e = (t) => (e) => typeof e === t,
|
||||||
|
o = (t) =>
|
||||||
|
"string" ===
|
||||||
|
((t) => {
|
||||||
|
const e = typeof t;
|
||||||
|
return null === t
|
||||||
|
? "null"
|
||||||
|
: "object" === e && Array.isArray(t)
|
||||||
|
? "array"
|
||||||
|
: "object" === e &&
|
||||||
|
((o = r = t),
|
||||||
|
(n = String).prototype.isPrototypeOf(o) ||
|
||||||
|
(null === (i = r.constructor) || void 0 === i
|
||||||
|
? void 0
|
||||||
|
: i.name) === n.name)
|
||||||
|
? "string"
|
||||||
|
: e;
|
||||||
|
var o, r, n, i;
|
||||||
|
})(t),
|
||||||
|
r = e("boolean"),
|
||||||
|
n = (t) => !((t) => null == t)(t),
|
||||||
|
i = e("function"),
|
||||||
|
s = e("number"),
|
||||||
|
l = (!1, () => false);
|
||||||
|
class a {
|
||||||
|
constructor(t, e) {
|
||||||
|
(this.tag = t), (this.value = e);
|
||||||
|
}
|
||||||
|
static some(t) {
|
||||||
|
return new a(!0, t);
|
||||||
|
}
|
||||||
|
static none() {
|
||||||
|
return a.singletonNone;
|
||||||
|
}
|
||||||
|
fold(t, e) {
|
||||||
|
return this.tag ? e(this.value) : t();
|
||||||
|
}
|
||||||
|
isSome() {
|
||||||
|
return this.tag;
|
||||||
|
}
|
||||||
|
isNone() {
|
||||||
|
return !this.tag;
|
||||||
|
}
|
||||||
|
map(t) {
|
||||||
|
return this.tag ? a.some(t(this.value)) : a.none();
|
||||||
|
}
|
||||||
|
bind(t) {
|
||||||
|
return this.tag ? t(this.value) : a.none();
|
||||||
|
}
|
||||||
|
exists(t) {
|
||||||
|
return this.tag && t(this.value);
|
||||||
|
}
|
||||||
|
forall(t) {
|
||||||
|
return !this.tag || t(this.value);
|
||||||
|
}
|
||||||
|
filter(t) {
|
||||||
|
return !this.tag || t(this.value) ? this : a.none();
|
||||||
|
}
|
||||||
|
getOr(t) {
|
||||||
|
return this.tag ? this.value : t;
|
||||||
|
}
|
||||||
|
or(t) {
|
||||||
|
return this.tag ? this : t;
|
||||||
|
}
|
||||||
|
getOrThunk(t) {
|
||||||
|
return this.tag ? this.value : t();
|
||||||
|
}
|
||||||
|
orThunk(t) {
|
||||||
|
return this.tag ? this : t();
|
||||||
|
}
|
||||||
|
getOrDie(t) {
|
||||||
|
if (this.tag) return this.value;
|
||||||
|
throw new Error(null != t ? t : "Called getOrDie on None");
|
||||||
|
}
|
||||||
|
static from(t) {
|
||||||
|
return n(t) ? a.some(t) : a.none();
|
||||||
|
}
|
||||||
|
getOrNull() {
|
||||||
|
return this.tag ? this.value : null;
|
||||||
|
}
|
||||||
|
getOrUndefined() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
each(t) {
|
||||||
|
this.tag && t(this.value);
|
||||||
|
}
|
||||||
|
toArray() {
|
||||||
|
return this.tag ? [this.value] : [];
|
||||||
|
}
|
||||||
|
toString() {
|
||||||
|
return this.tag ? `some(${this.value})` : "none()";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
a.singletonNone = new a(!1);
|
||||||
|
const u = (t, e) => {
|
||||||
|
for (let o = 0, r = t.length; o < r; o++) e(t[o], o);
|
||||||
|
},
|
||||||
|
c = (t) => {
|
||||||
|
if (null == t) throw new Error("Node cannot be null or undefined");
|
||||||
|
return { dom: t };
|
||||||
|
},
|
||||||
|
d = c,
|
||||||
|
h = (t, e) => {
|
||||||
|
const o = t.dom;
|
||||||
|
if (1 !== o.nodeType) return !1;
|
||||||
|
{
|
||||||
|
const t = o;
|
||||||
|
if (void 0 !== t.matches) return t.matches(e);
|
||||||
|
if (void 0 !== t.msMatchesSelector) return t.msMatchesSelector(e);
|
||||||
|
if (void 0 !== t.webkitMatchesSelector)
|
||||||
|
return t.webkitMatchesSelector(e);
|
||||||
|
if (void 0 !== t.mozMatchesSelector) return t.mozMatchesSelector(e);
|
||||||
|
throw new Error("Browser lacks native selectors");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
"undefined" != typeof window ? window : Function("return this;")();
|
||||||
|
const m = (t) => (e) => ((t) => t.dom.nodeType)(e) === t,
|
||||||
|
g = m(1),
|
||||||
|
f = m(3),
|
||||||
|
v = m(9),
|
||||||
|
y = m(11),
|
||||||
|
p = (t, e) => {
|
||||||
|
t.dom.removeAttribute(e);
|
||||||
|
},
|
||||||
|
w =
|
||||||
|
i(Element.prototype.attachShadow) && i(Node.prototype.getRootNode)
|
||||||
|
? (t) => d(t.dom.getRootNode())
|
||||||
|
: (t) => (v(t) ? t : d(t.dom.ownerDocument)),
|
||||||
|
b = (t) => d(t.dom.host),
|
||||||
|
N = (t) => {
|
||||||
|
const e = f(t) ? t.dom.parentNode : t.dom;
|
||||||
|
if (null == e || null === e.ownerDocument) return !1;
|
||||||
|
const o = e.ownerDocument;
|
||||||
|
return ((t) => {
|
||||||
|
const e = w(t);
|
||||||
|
return y((o = e)) && n(o.dom.host) ? a.some(e) : a.none();
|
||||||
|
var o;
|
||||||
|
})(d(e)).fold(
|
||||||
|
() => o.body.contains(e),
|
||||||
|
((r = N), (i = b), (t) => r(i(t))),
|
||||||
|
);
|
||||||
|
var r, i;
|
||||||
|
},
|
||||||
|
S = (t) =>
|
||||||
|
"rtl" ===
|
||||||
|
((t, e) => {
|
||||||
|
const o = t.dom,
|
||||||
|
r = window.getComputedStyle(o).getPropertyValue(e);
|
||||||
|
return "" !== r || N(t)
|
||||||
|
? r
|
||||||
|
: ((t, e) =>
|
||||||
|
((t) => void 0 !== t.style && i(t.style.getPropertyValue))(t)
|
||||||
|
? t.style.getPropertyValue(e)
|
||||||
|
: "")(o, e);
|
||||||
|
})(t, "direction")
|
||||||
|
? "rtl"
|
||||||
|
: "ltr",
|
||||||
|
A = (t, e) =>
|
||||||
|
((t, o) =>
|
||||||
|
((t, e) => {
|
||||||
|
const o = [];
|
||||||
|
for (let r = 0, n = t.length; r < n; r++) {
|
||||||
|
const n = t[r];
|
||||||
|
e(n, r) && o.push(n);
|
||||||
|
}
|
||||||
|
return o;
|
||||||
|
})(
|
||||||
|
((t, e) => {
|
||||||
|
const o = t.length,
|
||||||
|
r = new Array(o);
|
||||||
|
for (let n = 0; n < o; n++) {
|
||||||
|
const o = t[n];
|
||||||
|
r[n] = e(o, n);
|
||||||
|
}
|
||||||
|
return r;
|
||||||
|
})(t.dom.childNodes, d),
|
||||||
|
(t) => h(t, e),
|
||||||
|
))(t),
|
||||||
|
E = ("li", (t) => g(t) && "li" === t.dom.nodeName.toLowerCase());
|
||||||
|
const T = (t, e, n) => {
|
||||||
|
u(e, (e) => {
|
||||||
|
const c = d(e),
|
||||||
|
m = E(c),
|
||||||
|
f = ((t, e) => {
|
||||||
|
return (
|
||||||
|
e
|
||||||
|
? ((o = t),
|
||||||
|
(r = "ol,ul"),
|
||||||
|
((t, e, o) => {
|
||||||
|
let n = t.dom;
|
||||||
|
const s = i(o) ? o : l;
|
||||||
|
for (; n.parentNode; ) {
|
||||||
|
n = n.parentNode;
|
||||||
|
const t = d(n);
|
||||||
|
if (h(t, r)) return a.some(t);
|
||||||
|
if (s(t)) break;
|
||||||
|
}
|
||||||
|
return a.none();
|
||||||
|
})(o, 0, n))
|
||||||
|
: a.some(t)
|
||||||
|
).getOr(t);
|
||||||
|
var o, r, n;
|
||||||
|
})(c, m);
|
||||||
|
var v;
|
||||||
|
((v = f), ((t) => a.from(t.dom.parentNode).map(d))(v).filter(g)).each(
|
||||||
|
(e) => {
|
||||||
|
if (
|
||||||
|
(t.setStyle(f.dom, "direction", null),
|
||||||
|
S(e) === n
|
||||||
|
? p(f, "dir")
|
||||||
|
: ((t, e, n) => {
|
||||||
|
((t, e, n) => {
|
||||||
|
if (!(o(n) || r(n) || s(n)))
|
||||||
|
throw (
|
||||||
|
(console.error(
|
||||||
|
"Invalid call to Attribute.set. Key ",
|
||||||
|
e,
|
||||||
|
":: Value ",
|
||||||
|
n,
|
||||||
|
":: Element ",
|
||||||
|
t,
|
||||||
|
),
|
||||||
|
new Error("Attribute value was not simple"))
|
||||||
|
);
|
||||||
|
t.setAttribute(e, n + "");
|
||||||
|
})(t.dom, e, n);
|
||||||
|
})(f, "dir", n),
|
||||||
|
S(f) !== n && t.setStyle(f.dom, "direction", n),
|
||||||
|
m)
|
||||||
|
) {
|
||||||
|
const e = A(f, "li[dir],li[style]");
|
||||||
|
u(e, (e) => {
|
||||||
|
p(e, "dir"), t.setStyle(e.dom, "direction", null);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
C = (t, e) => {
|
||||||
|
t.selection.isEditable() &&
|
||||||
|
(T(t.dom, t.selection.getSelectedBlocks(), e), t.nodeChanged());
|
||||||
|
},
|
||||||
|
D = (t, e) => (o) => {
|
||||||
|
const r = (r) => {
|
||||||
|
const n = d(r.element);
|
||||||
|
o.setActive(S(n) === e), o.setEnabled(t.selection.isEditable());
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
t.on("NodeChange", r),
|
||||||
|
o.setEnabled(t.selection.isEditable()),
|
||||||
|
() => t.off("NodeChange", r)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
t.add("directionality", (t) => {
|
||||||
|
((t) => {
|
||||||
|
t.addCommand("mceDirectionLTR", () => {
|
||||||
|
C(t, "ltr");
|
||||||
|
}),
|
||||||
|
t.addCommand("mceDirectionRTL", () => {
|
||||||
|
C(t, "rtl");
|
||||||
|
});
|
||||||
|
})(t),
|
||||||
|
((t) => {
|
||||||
|
t.ui.registry.addToggleButton("ltr", {
|
||||||
|
tooltip: "Left to right",
|
||||||
|
icon: "ltr",
|
||||||
|
onAction: () => t.execCommand("mceDirectionLTR"),
|
||||||
|
onSetup: D(t, "ltr"),
|
||||||
|
}),
|
||||||
|
t.ui.registry.addToggleButton("rtl", {
|
||||||
|
tooltip: "Right to left",
|
||||||
|
icon: "rtl",
|
||||||
|
onAction: () => t.execCommand("mceDirectionRTL"),
|
||||||
|
onSetup: D(t, "rtl"),
|
||||||
|
});
|
||||||
|
})(t);
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
1172
src/lib/dist/tinymce/plugins/image/plugin.min.js
vendored
1172
src/lib/dist/tinymce/plugins/image/plugin.min.js
vendored
File diff suppressed because one or more lines are too long
261
src/lib/dist/tinymce/plugins/importcss/plugin.min.js
vendored
261
src/lib/dist/tinymce/plugins/importcss/plugin.min.js
vendored
@ -1,4 +1,263 @@
|
|||||||
/**
|
/**
|
||||||
* TinyMCE version 6.7.0 (2023-08-30)
|
* TinyMCE version 6.7.0 (2023-08-30)
|
||||||
*/
|
*/
|
||||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(s=r=e,(o=String).prototype.isPrototypeOf(s)||(null===(n=r.constructor)||void 0===n?void 0:n.name)===o.name)?"string":t;var s,r,o,n})(t)===e,s=t("string"),r=t("object"),o=t("array"),n=("function",e=>"function"==typeof e);var c=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),i=tinymce.util.Tools.resolve("tinymce.EditorManager"),l=tinymce.util.Tools.resolve("tinymce.Env"),a=tinymce.util.Tools.resolve("tinymce.util.Tools");const p=e=>t=>t.options.get(e),u=p("importcss_merge_classes"),m=p("importcss_exclusive"),f=p("importcss_selector_converter"),y=p("importcss_selector_filter"),d=p("importcss_groups"),h=p("importcss_append"),_=p("importcss_file_filter"),g=p("skin"),v=p("skin_url"),b=Array.prototype.push,x=/^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/,T=e=>s(e)?t=>-1!==t.indexOf(e):e instanceof RegExp?t=>e.test(t):e,S=(e,t)=>{let s={};const r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(t);if(!r)return;const o=r[1],n=r[2].substr(1).split(".").join(" "),c=a.makeMap("a,img");return r[1]?(s={title:t},e.schema.getTextBlockElements()[o]?s.block=o:e.schema.getBlockElements()[o]||c[o.toLowerCase()]?s.selector=o:s.inline=o):r[2]&&(s={inline:"span",title:t.substr(1),classes:n}),u(e)?s.classes=n:s.attributes={class:n},s},k=(e,t)=>null===t||m(e),w=e=>{e.on("init",(()=>{const t=(()=>{const e=[],t=[],s={};return{addItemToGroup:(e,r)=>{s[e]?s[e].push(r):(t.push(e),s[e]=[r])},addItem:t=>{e.push(t)},toFormats:()=>{return(r=t,n=e=>{const t=s[e];return 0===t.length?[]:[{title:e,items:t}]},(e=>{const t=[];for(let s=0,r=e.length;s<r;++s){if(!o(e[s]))throw new Error("Arr.flatten item "+s+" was not an array, input: "+e);b.apply(t,e[s])}return t})(((e,t)=>{const s=e.length,r=new Array(s);for(let o=0;o<s;o++){const s=e[o];r[o]=t(s,o)}return r})(r,n))).concat(e);var r,n}}})(),r={},n=T(y(e)),p=(e=>a.map(e,(e=>a.extend({},e,{original:e,selectors:{},filter:T(e.filter)}))))(d(e)),u=(t,s)=>{if(((e,t,s,r)=>!(k(e,s)?t in r:t in s.selectors))(e,t,s,r)){((e,t,s,r)=>{k(e,s)?r[t]=!0:s.selectors[t]=!0})(e,t,s,r);const o=((e,t,s,r)=>{let o;const n=f(e);return o=r&&r.selector_converter?r.selector_converter:n||(()=>S(e,s)),o.call(t,s,r)})(e,e.plugins.importcss,t,s);if(o){const t=o.name||c.DOM.uniqueId();return e.formatter.register(t,o),{title:o.title,format:t}}}return null};a.each(((e,t,r)=>{const o=[],n={},c=(t,n)=>{let p,u=t.href;if(u=(e=>{const t=l.cacheSuffix;return s(e)&&(e=e.replace("?"+t,"").replace("&"+t,"")),e})(u),u&&(!r||r(u,n))&&!((e,t)=>{const s=g(e);if(s){const r=v(e),o=r?e.documentBaseURI.toAbsolute(r):i.baseURL+"/skins/ui/"+s,n=i.baseURL+"/skins/content/";return t===o+"/content"+(e.inline?".inline":"")+".min.css"||-1!==t.indexOf(n)}return!1})(e,u)){a.each(t.imports,(e=>{c(e,!0)}));try{p=t.cssRules||t.rules}catch(e){}a.each(p,(e=>{e.styleSheet?c(e.styleSheet,!0):e.selectorText&&a.each(e.selectorText.split(","),(e=>{o.push(a.trim(e))}))}))}};a.each(e.contentCSS,(e=>{n[e]=!0})),r||(r=(e,t)=>t||n[e]);try{a.each(t.styleSheets,(e=>{c(e)}))}catch(e){}return o})(e,e.getDoc(),T(_(e))),(e=>{if(!x.test(e)&&(!n||n(e))){const s=((e,t)=>a.grep(e,(e=>!e.filter||e.filter(t))))(p,e);if(s.length>0)a.each(s,(s=>{const r=u(e,s);r&&t.addItemToGroup(s.title,r)}));else{const s=u(e,null);s&&t.addItem(s)}}}));const m=t.toFormats();e.dispatch("addStyleModifications",{items:m,replace:!h(e)})}))};e.add("importcss",(e=>((e=>{const t=e.options.register,o=e=>s(e)||n(e)||r(e);t("importcss_merge_classes",{processor:"boolean",default:!0}),t("importcss_exclusive",{processor:"boolean",default:!0}),t("importcss_selector_converter",{processor:"function"}),t("importcss_selector_filter",{processor:o}),t("importcss_file_filter",{processor:o}),t("importcss_groups",{processor:"object[]"}),t("importcss_append",{processor:"boolean",default:!1})})(e),w(e),(e=>({convertSelectorToFormat:t=>S(e,t)}))(e))))}();
|
!(function () {
|
||||||
|
"use strict";
|
||||||
|
var e = tinymce.util.Tools.resolve("tinymce.PluginManager");
|
||||||
|
const t = (e) => (t) =>
|
||||||
|
((e) => {
|
||||||
|
const t = typeof e;
|
||||||
|
return null === e
|
||||||
|
? "null"
|
||||||
|
: "object" === t && Array.isArray(e)
|
||||||
|
? "array"
|
||||||
|
: "object" === t &&
|
||||||
|
((s = r = e),
|
||||||
|
(o = String).prototype.isPrototypeOf(s) ||
|
||||||
|
(null === (n = r.constructor) || void 0 === n
|
||||||
|
? void 0
|
||||||
|
: n.name) === o.name)
|
||||||
|
? "string"
|
||||||
|
: t;
|
||||||
|
var s, r, o, n;
|
||||||
|
})(t) === e,
|
||||||
|
s = t("string"),
|
||||||
|
r = t("object"),
|
||||||
|
o = t("array"),
|
||||||
|
n = ("function", (e) => "function" == typeof e);
|
||||||
|
var c = tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),
|
||||||
|
i = tinymce.util.Tools.resolve("tinymce.EditorManager"),
|
||||||
|
l = tinymce.util.Tools.resolve("tinymce.Env"),
|
||||||
|
a = tinymce.util.Tools.resolve("tinymce.util.Tools");
|
||||||
|
const p = (e) => (t) => t.options.get(e),
|
||||||
|
u = p("importcss_merge_classes"),
|
||||||
|
m = p("importcss_exclusive"),
|
||||||
|
f = p("importcss_selector_converter"),
|
||||||
|
y = p("importcss_selector_filter"),
|
||||||
|
d = p("importcss_groups"),
|
||||||
|
h = p("importcss_append"),
|
||||||
|
_ = p("importcss_file_filter"),
|
||||||
|
g = p("skin"),
|
||||||
|
v = p("skin_url"),
|
||||||
|
b = Array.prototype.push,
|
||||||
|
x = /^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/,
|
||||||
|
T = (e) =>
|
||||||
|
s(e)
|
||||||
|
? (t) => -1 !== t.indexOf(e)
|
||||||
|
: e instanceof RegExp
|
||||||
|
? (t) => e.test(t)
|
||||||
|
: e,
|
||||||
|
S = (e, t) => {
|
||||||
|
let s = {};
|
||||||
|
const r = /^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(t);
|
||||||
|
if (!r) return;
|
||||||
|
const o = r[1],
|
||||||
|
n = r[2].substr(1).split(".").join(" "),
|
||||||
|
c = a.makeMap("a,img");
|
||||||
|
return (
|
||||||
|
r[1]
|
||||||
|
? ((s = { title: t }),
|
||||||
|
e.schema.getTextBlockElements()[o]
|
||||||
|
? (s.block = o)
|
||||||
|
: e.schema.getBlockElements()[o] || c[o.toLowerCase()]
|
||||||
|
? (s.selector = o)
|
||||||
|
: (s.inline = o))
|
||||||
|
: r[2] && (s = { inline: "span", title: t.substr(1), classes: n }),
|
||||||
|
u(e) ? (s.classes = n) : (s.attributes = { class: n }),
|
||||||
|
s
|
||||||
|
);
|
||||||
|
},
|
||||||
|
k = (e, t) => null === t || m(e),
|
||||||
|
w = (e) => {
|
||||||
|
e.on("init", () => {
|
||||||
|
const t = (() => {
|
||||||
|
const e = [],
|
||||||
|
t = [],
|
||||||
|
s = {};
|
||||||
|
return {
|
||||||
|
addItemToGroup: (e, r) => {
|
||||||
|
s[e] ? s[e].push(r) : (t.push(e), (s[e] = [r]));
|
||||||
|
},
|
||||||
|
addItem: (t) => {
|
||||||
|
e.push(t);
|
||||||
|
},
|
||||||
|
toFormats: () => {
|
||||||
|
return ((r = t),
|
||||||
|
(n = (e) => {
|
||||||
|
const t = s[e];
|
||||||
|
return 0 === t.length ? [] : [{ title: e, items: t }];
|
||||||
|
}),
|
||||||
|
((e) => {
|
||||||
|
const t = [];
|
||||||
|
for (let s = 0, r = e.length; s < r; ++s) {
|
||||||
|
if (!o(e[s]))
|
||||||
|
throw new Error(
|
||||||
|
"Arr.flatten item " +
|
||||||
|
s +
|
||||||
|
" was not an array, input: " +
|
||||||
|
e,
|
||||||
|
);
|
||||||
|
b.apply(t, e[s]);
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
})(
|
||||||
|
((e, t) => {
|
||||||
|
const s = e.length,
|
||||||
|
r = new Array(s);
|
||||||
|
for (let o = 0; o < s; o++) {
|
||||||
|
const s = e[o];
|
||||||
|
r[o] = t(s, o);
|
||||||
|
}
|
||||||
|
return r;
|
||||||
|
})(r, n),
|
||||||
|
)).concat(e);
|
||||||
|
var r, n;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
})(),
|
||||||
|
r = {},
|
||||||
|
n = T(y(e)),
|
||||||
|
p = ((e) =>
|
||||||
|
a.map(e, (e) =>
|
||||||
|
a.extend({}, e, {
|
||||||
|
original: e,
|
||||||
|
selectors: {},
|
||||||
|
filter: T(e.filter),
|
||||||
|
}),
|
||||||
|
))(d(e)),
|
||||||
|
u = (t, s) => {
|
||||||
|
if (
|
||||||
|
((e, t, s, r) => !(k(e, s) ? t in r : t in s.selectors))(
|
||||||
|
e,
|
||||||
|
t,
|
||||||
|
s,
|
||||||
|
r,
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
((e, t, s, r) => {
|
||||||
|
k(e, s) ? (r[t] = !0) : (s.selectors[t] = !0);
|
||||||
|
})(e, t, s, r);
|
||||||
|
const o = ((e, t, s, r) => {
|
||||||
|
let o;
|
||||||
|
const n = f(e);
|
||||||
|
return (
|
||||||
|
(o =
|
||||||
|
r && r.selector_converter
|
||||||
|
? r.selector_converter
|
||||||
|
: n || (() => S(e, s))),
|
||||||
|
o.call(t, s, r)
|
||||||
|
);
|
||||||
|
})(e, e.plugins.importcss, t, s);
|
||||||
|
if (o) {
|
||||||
|
const t = o.name || c.DOM.uniqueId();
|
||||||
|
return (
|
||||||
|
e.formatter.register(t, o), { title: o.title, format: t }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
a.each(
|
||||||
|
((e, t, r) => {
|
||||||
|
const o = [],
|
||||||
|
n = {},
|
||||||
|
c = (t, n) => {
|
||||||
|
let p,
|
||||||
|
u = t.href;
|
||||||
|
if (
|
||||||
|
((u = ((e) => {
|
||||||
|
const t = l.cacheSuffix;
|
||||||
|
return (
|
||||||
|
s(e) && (e = e.replace("?" + t, "").replace("&" + t, "")),
|
||||||
|
e
|
||||||
|
);
|
||||||
|
})(u)),
|
||||||
|
u &&
|
||||||
|
(!r || r(u, n)) &&
|
||||||
|
!((e, t) => {
|
||||||
|
const s = g(e);
|
||||||
|
if (s) {
|
||||||
|
const r = v(e),
|
||||||
|
o = r
|
||||||
|
? e.documentBaseURI.toAbsolute(r)
|
||||||
|
: i.baseURL + "/skins/ui/" + s,
|
||||||
|
n = i.baseURL + "/skins/content/";
|
||||||
|
return (
|
||||||
|
t ===
|
||||||
|
o +
|
||||||
|
"/content" +
|
||||||
|
(e.inline ? ".inline" : "") +
|
||||||
|
".min.css" || -1 !== t.indexOf(n)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return !1;
|
||||||
|
})(e, u))
|
||||||
|
) {
|
||||||
|
a.each(t.imports, (e) => {
|
||||||
|
c(e, !0);
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
p = t.cssRules || t.rules;
|
||||||
|
} catch (e) {}
|
||||||
|
a.each(p, (e) => {
|
||||||
|
e.styleSheet
|
||||||
|
? c(e.styleSheet, !0)
|
||||||
|
: e.selectorText &&
|
||||||
|
a.each(e.selectorText.split(","), (e) => {
|
||||||
|
o.push(a.trim(e));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
a.each(e.contentCSS, (e) => {
|
||||||
|
n[e] = !0;
|
||||||
|
}),
|
||||||
|
r || (r = (e, t) => t || n[e]);
|
||||||
|
try {
|
||||||
|
a.each(t.styleSheets, (e) => {
|
||||||
|
c(e);
|
||||||
|
});
|
||||||
|
} catch (e) {}
|
||||||
|
return o;
|
||||||
|
})(e, e.getDoc(), T(_(e))),
|
||||||
|
(e) => {
|
||||||
|
if (!x.test(e) && (!n || n(e))) {
|
||||||
|
const s = ((e, t) => a.grep(e, (e) => !e.filter || e.filter(t)))(
|
||||||
|
p,
|
||||||
|
e,
|
||||||
|
);
|
||||||
|
if (s.length > 0)
|
||||||
|
a.each(s, (s) => {
|
||||||
|
const r = u(e, s);
|
||||||
|
r && t.addItemToGroup(s.title, r);
|
||||||
|
});
|
||||||
|
else {
|
||||||
|
const s = u(e, null);
|
||||||
|
s && t.addItem(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
const m = t.toFormats();
|
||||||
|
e.dispatch("addStyleModifications", { items: m, replace: !h(e) });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
e.add(
|
||||||
|
"importcss",
|
||||||
|
(e) => (
|
||||||
|
((e) => {
|
||||||
|
const t = e.options.register,
|
||||||
|
o = (e) => s(e) || n(e) || r(e);
|
||||||
|
t("importcss_merge_classes", { processor: "boolean", default: !0 }),
|
||||||
|
t("importcss_exclusive", { processor: "boolean", default: !0 }),
|
||||||
|
t("importcss_selector_converter", { processor: "function" }),
|
||||||
|
t("importcss_selector_filter", { processor: o }),
|
||||||
|
t("importcss_file_filter", { processor: o }),
|
||||||
|
t("importcss_groups", { processor: "object[]" }),
|
||||||
|
t("importcss_append", { processor: "boolean", default: !1 });
|
||||||
|
})(e),
|
||||||
|
w(e),
|
||||||
|
((e) => ({ convertSelectorToFormat: (t) => S(e, t) }))(e)
|
||||||
|
),
|
||||||
|
);
|
||||||
|
})();
|
||||||
|
|||||||
@ -1,4 +1,158 @@
|
|||||||
/**
|
/**
|
||||||
* TinyMCE version 6.7.0 (2023-08-30)
|
* TinyMCE version 6.7.0 (2023-08-30)
|
||||||
*/
|
*/
|
||||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),a=t("insertdatetime_dateformat"),n=t("insertdatetime_timeformat"),r=t("insertdatetime_formats"),s=t("insertdatetime_element"),i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),o="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),l="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),m="January February March April May June July August September October November December".split(" "),c=(e,t)=>{if((e=""+e).length<t)for(let a=0;a<t-e.length;a++)e="0"+e;return e},d=(e,t,a=new Date)=>(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+a.getFullYear())).replace("%y",""+a.getYear())).replace("%m",c(a.getMonth()+1,2))).replace("%d",c(a.getDate(),2))).replace("%H",""+c(a.getHours(),2))).replace("%M",""+c(a.getMinutes(),2))).replace("%S",""+c(a.getSeconds(),2))).replace("%I",""+((a.getHours()+11)%12+1))).replace("%p",a.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(m[a.getMonth()]))).replace("%b",""+e.translate(l[a.getMonth()]))).replace("%A",""+e.translate(o[a.getDay()]))).replace("%a",""+e.translate(i[a.getDay()]))).replace("%%","%"),u=(e,t)=>{if(s(e)){const a=d(e,t);let n;n=/%[HMSIp]/.test(t)?d(e,"%Y-%m-%dT%H:%M"):d(e,"%Y-%m-%d");const r=e.dom.getParent(e.selection.getStart(),"time");r?((e,t,a,n)=>{const r=e.dom.create("time",{datetime:a},n);e.dom.replace(r,t),e.selection.select(r,!0),e.selection.collapse(!1)})(e,r,n,a):e.insertContent('<time datetime="'+n+'">'+a+"</time>")}else e.insertContent(d(e,t))};var p=tinymce.util.Tools.resolve("tinymce.util.Tools");const g=e=>t=>{const a=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",a),a(),()=>{e.off("NodeChange",a)}};e.add("insertdatetime",(e=>{(e=>{const t=e.options.register;t("insertdatetime_dateformat",{processor:"string",default:e.translate("%Y-%m-%d")}),t("insertdatetime_timeformat",{processor:"string",default:e.translate("%H:%M:%S")}),t("insertdatetime_formats",{processor:"string[]",default:["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"]}),t("insertdatetime_element",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mceInsertDate",((t,n)=>{u(e,null!=n?n:a(e))})),e.addCommand("mceInsertTime",((t,a)=>{u(e,null!=a?a:n(e))}))})(e),(e=>{const t=r(e),a=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})((e=>{const t=r(e);return t.length>0?t[0]:n(e)})(e)),s=t=>e.execCommand("mceInsertDate",!1,t);e.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:e=>e===a.get(),fetch:a=>{a(p.map(t,(t=>({type:"choiceitem",text:d(e,t),value:t}))))},onAction:e=>{s(a.get())},onItemAction:(e,t)=>{a.set(t),s(t)},onSetup:g(e)});const i=e=>()=>{a.set(e),s(e)};e.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:()=>p.map(t,(t=>({type:"menuitem",text:d(e,t),onAction:i(t)}))),onSetup:g(e)})})(e)}))}();
|
!(function () {
|
||||||
|
"use strict";
|
||||||
|
var e = tinymce.util.Tools.resolve("tinymce.PluginManager");
|
||||||
|
const t = (e) => (t) => t.options.get(e),
|
||||||
|
a = t("insertdatetime_dateformat"),
|
||||||
|
n = t("insertdatetime_timeformat"),
|
||||||
|
r = t("insertdatetime_formats"),
|
||||||
|
s = t("insertdatetime_element"),
|
||||||
|
i = "Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),
|
||||||
|
o = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(
|
||||||
|
" ",
|
||||||
|
),
|
||||||
|
l = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),
|
||||||
|
m =
|
||||||
|
"January February March April May June July August September October November December".split(
|
||||||
|
" ",
|
||||||
|
),
|
||||||
|
c = (e, t) => {
|
||||||
|
if ((e = "" + e).length < t)
|
||||||
|
for (let a = 0; a < t - e.length; a++) e = "0" + e;
|
||||||
|
return e;
|
||||||
|
},
|
||||||
|
d = (e, t, a = new Date()) =>
|
||||||
|
(t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t = (t =
|
||||||
|
t.replace("%D", "%m/%d/%Y")).replace("%r", "%I:%M:%S %p")).replace(
|
||||||
|
"%Y",
|
||||||
|
"" + a.getFullYear(),
|
||||||
|
)).replace("%y", "" + a.getYear())).replace(
|
||||||
|
"%m",
|
||||||
|
c(a.getMonth() + 1, 2),
|
||||||
|
)).replace("%d", c(a.getDate(), 2))).replace(
|
||||||
|
"%H",
|
||||||
|
"" + c(a.getHours(), 2),
|
||||||
|
)).replace("%M", "" + c(a.getMinutes(), 2))).replace(
|
||||||
|
"%S",
|
||||||
|
"" + c(a.getSeconds(), 2),
|
||||||
|
)).replace("%I", "" + (((a.getHours() + 11) % 12) + 1))).replace(
|
||||||
|
"%p",
|
||||||
|
a.getHours() < 12 ? "AM" : "PM",
|
||||||
|
)).replace("%B", "" + e.translate(m[a.getMonth()]))).replace(
|
||||||
|
"%b",
|
||||||
|
"" + e.translate(l[a.getMonth()]),
|
||||||
|
)).replace("%A", "" + e.translate(o[a.getDay()]))).replace(
|
||||||
|
"%a",
|
||||||
|
"" + e.translate(i[a.getDay()]),
|
||||||
|
)).replace("%%", "%"),
|
||||||
|
u = (e, t) => {
|
||||||
|
if (s(e)) {
|
||||||
|
const a = d(e, t);
|
||||||
|
let n;
|
||||||
|
n = /%[HMSIp]/.test(t) ? d(e, "%Y-%m-%dT%H:%M") : d(e, "%Y-%m-%d");
|
||||||
|
const r = e.dom.getParent(e.selection.getStart(), "time");
|
||||||
|
r
|
||||||
|
? ((e, t, a, n) => {
|
||||||
|
const r = e.dom.create("time", { datetime: a }, n);
|
||||||
|
e.dom.replace(r, t),
|
||||||
|
e.selection.select(r, !0),
|
||||||
|
e.selection.collapse(!1);
|
||||||
|
})(e, r, n, a)
|
||||||
|
: e.insertContent('<time datetime="' + n + '">' + a + "</time>");
|
||||||
|
} else e.insertContent(d(e, t));
|
||||||
|
};
|
||||||
|
var p = tinymce.util.Tools.resolve("tinymce.util.Tools");
|
||||||
|
const g = (e) => (t) => {
|
||||||
|
const a = () => {
|
||||||
|
t.setEnabled(e.selection.isEditable());
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
e.on("NodeChange", a),
|
||||||
|
a(),
|
||||||
|
() => {
|
||||||
|
e.off("NodeChange", a);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
e.add("insertdatetime", (e) => {
|
||||||
|
((e) => {
|
||||||
|
const t = e.options.register;
|
||||||
|
t("insertdatetime_dateformat", {
|
||||||
|
processor: "string",
|
||||||
|
default: e.translate("%Y-%m-%d"),
|
||||||
|
}),
|
||||||
|
t("insertdatetime_timeformat", {
|
||||||
|
processor: "string",
|
||||||
|
default: e.translate("%H:%M:%S"),
|
||||||
|
}),
|
||||||
|
t("insertdatetime_formats", {
|
||||||
|
processor: "string[]",
|
||||||
|
default: ["%H:%M:%S", "%Y-%m-%d", "%I:%M:%S %p", "%D"],
|
||||||
|
}),
|
||||||
|
t("insertdatetime_element", { processor: "boolean", default: !1 });
|
||||||
|
})(e),
|
||||||
|
((e) => {
|
||||||
|
e.addCommand("mceInsertDate", (t, n) => {
|
||||||
|
u(e, null != n ? n : a(e));
|
||||||
|
}),
|
||||||
|
e.addCommand("mceInsertTime", (t, a) => {
|
||||||
|
u(e, null != a ? a : n(e));
|
||||||
|
});
|
||||||
|
})(e),
|
||||||
|
((e) => {
|
||||||
|
const t = r(e),
|
||||||
|
a = ((e) => {
|
||||||
|
let t = e;
|
||||||
|
return {
|
||||||
|
get: () => t,
|
||||||
|
set: (e) => {
|
||||||
|
t = e;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
})(
|
||||||
|
((e) => {
|
||||||
|
const t = r(e);
|
||||||
|
return t.length > 0 ? t[0] : n(e);
|
||||||
|
})(e),
|
||||||
|
),
|
||||||
|
s = (t) => e.execCommand("mceInsertDate", !1, t);
|
||||||
|
e.ui.registry.addSplitButton("insertdatetime", {
|
||||||
|
icon: "insert-time",
|
||||||
|
tooltip: "Insert date/time",
|
||||||
|
select: (e) => e === a.get(),
|
||||||
|
fetch: (a) => {
|
||||||
|
a(
|
||||||
|
p.map(t, (t) => ({
|
||||||
|
type: "choiceitem",
|
||||||
|
text: d(e, t),
|
||||||
|
value: t,
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
onAction: (e) => {
|
||||||
|
s(a.get());
|
||||||
|
},
|
||||||
|
onItemAction: (e, t) => {
|
||||||
|
a.set(t), s(t);
|
||||||
|
},
|
||||||
|
onSetup: g(e),
|
||||||
|
});
|
||||||
|
const i = (e) => () => {
|
||||||
|
a.set(e), s(e);
|
||||||
|
};
|
||||||
|
e.ui.registry.addNestedMenuItem("insertdatetime", {
|
||||||
|
icon: "insert-time",
|
||||||
|
text: "Date/time",
|
||||||
|
getSubmenuItems: () =>
|
||||||
|
p.map(t, (t) => ({
|
||||||
|
type: "menuitem",
|
||||||
|
text: d(e, t),
|
||||||
|
onAction: i(t),
|
||||||
|
})),
|
||||||
|
onSetup: g(e),
|
||||||
|
});
|
||||||
|
})(e);
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|||||||
1008
src/lib/dist/tinymce/plugins/link/plugin.min.js
vendored
1008
src/lib/dist/tinymce/plugins/link/plugin.min.js
vendored
File diff suppressed because one or more lines are too long
1543
src/lib/dist/tinymce/plugins/lists/plugin.min.js
vendored
1543
src/lib/dist/tinymce/plugins/lists/plugin.min.js
vendored
File diff suppressed because one or more lines are too long
1066
src/lib/dist/tinymce/plugins/media/plugin.min.js
vendored
1066
src/lib/dist/tinymce/plugins/media/plugin.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,4 +1,83 @@
|
|||||||
/**
|
/**
|
||||||
* TinyMCE version 6.7.0 (2023-08-30)
|
* TinyMCE version 6.7.0 (2023-08-30)
|
||||||
*/
|
*/
|
||||||
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=n=>e=>typeof e===n,o=e("boolean"),a=e("number"),t=n=>e=>e.options.get(n),i=t("nonbreaking_force_tab"),s=t("nonbreaking_wrap"),r=(n,e)=>{let o="";for(let a=0;a<e;a++)o+=n;return o},c=(n,e)=>{const o=s(n)||n.plugins.visualchars?`<span class="${(n=>!!n.plugins.visualchars&&n.plugins.visualchars.isEnabled())(n)?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap"}" contenteditable="false">${r(" ",e)}</span>`:r(" ",e);n.undoManager.transact((()=>n.insertContent(o)))};var l=tinymce.util.Tools.resolve("tinymce.util.VK");const u=n=>e=>{const o=()=>{e.setEnabled(n.selection.isEditable())};return n.on("NodeChange",o),o(),()=>{n.off("NodeChange",o)}};n.add("nonbreaking",(n=>{(n=>{const e=n.options.register;e("nonbreaking_force_tab",{processor:n=>o(n)?{value:n?3:0,valid:!0}:a(n)?{value:n,valid:!0}:{valid:!1,message:"Must be a boolean or number."},default:!1}),e("nonbreaking_wrap",{processor:"boolean",default:!0})})(n),(n=>{n.addCommand("mceNonBreaking",(()=>{c(n,1)}))})(n),(n=>{const e=()=>n.execCommand("mceNonBreaking");n.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:e,onSetup:u(n)}),n.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:e,onSetup:u(n)})})(n),(n=>{const e=i(n);e>0&&n.on("keydown",(o=>{if(o.keyCode===l.TAB&&!o.isDefaultPrevented()){if(o.shiftKey)return;o.preventDefault(),o.stopImmediatePropagation(),c(n,e)}}))})(n)}))}();
|
!(function () {
|
||||||
|
"use strict";
|
||||||
|
var n = tinymce.util.Tools.resolve("tinymce.PluginManager");
|
||||||
|
const e = (n) => (e) => typeof e === n,
|
||||||
|
o = e("boolean"),
|
||||||
|
a = e("number"),
|
||||||
|
t = (n) => (e) => e.options.get(n),
|
||||||
|
i = t("nonbreaking_force_tab"),
|
||||||
|
s = t("nonbreaking_wrap"),
|
||||||
|
r = (n, e) => {
|
||||||
|
let o = "";
|
||||||
|
for (let a = 0; a < e; a++) o += n;
|
||||||
|
return o;
|
||||||
|
},
|
||||||
|
c = (n, e) => {
|
||||||
|
const o =
|
||||||
|
s(n) || n.plugins.visualchars
|
||||||
|
? `<span class="${((n) => !!n.plugins.visualchars && n.plugins.visualchars.isEnabled())(n) ? "mce-nbsp-wrap mce-nbsp" : "mce-nbsp-wrap"}" contenteditable="false">${r(" ", e)}</span>`
|
||||||
|
: r(" ", e);
|
||||||
|
n.undoManager.transact(() => n.insertContent(o));
|
||||||
|
};
|
||||||
|
var l = tinymce.util.Tools.resolve("tinymce.util.VK");
|
||||||
|
const u = (n) => (e) => {
|
||||||
|
const o = () => {
|
||||||
|
e.setEnabled(n.selection.isEditable());
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
n.on("NodeChange", o),
|
||||||
|
o(),
|
||||||
|
() => {
|
||||||
|
n.off("NodeChange", o);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
n.add("nonbreaking", (n) => {
|
||||||
|
((n) => {
|
||||||
|
const e = n.options.register;
|
||||||
|
e("nonbreaking_force_tab", {
|
||||||
|
processor: (n) =>
|
||||||
|
o(n)
|
||||||
|
? { value: n ? 3 : 0, valid: !0 }
|
||||||
|
: a(n)
|
||||||
|
? { value: n, valid: !0 }
|
||||||
|
: { valid: !1, message: "Must be a boolean or number." },
|
||||||
|
default: !1,
|
||||||
|
}),
|
||||||
|
e("nonbreaking_wrap", { processor: "boolean", default: !0 });
|
||||||
|
})(n),
|
||||||
|
((n) => {
|
||||||
|
n.addCommand("mceNonBreaking", () => {
|
||||||
|
c(n, 1);
|
||||||
|
});
|
||||||
|
})(n),
|
||||||
|
((n) => {
|
||||||
|
const e = () => n.execCommand("mceNonBreaking");
|
||||||
|
n.ui.registry.addButton("nonbreaking", {
|
||||||
|
icon: "non-breaking",
|
||||||
|
tooltip: "Nonbreaking space",
|
||||||
|
onAction: e,
|
||||||
|
onSetup: u(n),
|
||||||
|
}),
|
||||||
|
n.ui.registry.addMenuItem("nonbreaking", {
|
||||||
|
icon: "non-breaking",
|
||||||
|
text: "Nonbreaking space",
|
||||||
|
onAction: e,
|
||||||
|
onSetup: u(n),
|
||||||
|
});
|
||||||
|
})(n),
|
||||||
|
((n) => {
|
||||||
|
const e = i(n);
|
||||||
|
e > 0 &&
|
||||||
|
n.on("keydown", (o) => {
|
||||||
|
if (o.keyCode === l.TAB && !o.isDefaultPrevented()) {
|
||||||
|
if (o.shiftKey) return;
|
||||||
|
o.preventDefault(), o.stopImmediatePropagation(), c(n, e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})(n);
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|||||||
@ -1,4 +1,94 @@
|
|||||||
/**
|
/**
|
||||||
* TinyMCE version 6.7.0 (2023-08-30)
|
* TinyMCE version 6.7.0 (2023-08-30)
|
||||||
*/
|
*/
|
||||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env");const t=e=>a=>a.options.get(e),n=t("pagebreak_separator"),o=t("pagebreak_split_block"),r="mce-pagebreak",s=e=>{const t=`<img src="${a.transparentSrc}" class="${r}" data-mce-resize="false" data-mce-placeholder />`;return e?`<p>${t}</p>`:t},c=e=>a=>{const t=()=>{a.setEnabled(e.selection.isEditable())};return e.on("NodeChange",t),t(),()=>{e.off("NodeChange",t)}};e.add("pagebreak",(e=>{(e=>{const a=e.options.register;a("pagebreak_separator",{processor:"string",default:"\x3c!-- pagebreak --\x3e"}),a("pagebreak_split_block",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mcePageBreak",(()=>{e.insertContent(s(o(e)))}))})(e),(e=>{const a=()=>e.execCommand("mcePageBreak");e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:a,onSetup:c(e)}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:a,onSetup:c(e)})})(e),(e=>{const a=n(e),t=()=>o(e),c=new RegExp(a.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,(e=>"\\"+e)),"gi");e.on("BeforeSetContent",(e=>{e.content=e.content.replace(c,s(t()))})),e.on("PreInit",(()=>{e.serializer.addNodeFilter("img",(n=>{let o,s,c=n.length;for(;c--;)if(o=n[c],s=o.attr("class"),s&&-1!==s.indexOf(r)){const n=o.parent;if(n&&e.schema.getBlockElements()[n.name]&&t()){n.type=3,n.value=a,n.raw=!0,o.remove();continue}o.type=3,o.value=a,o.raw=!0}}))}))})(e),(e=>{e.on("ResolveName",(a=>{"IMG"===a.target.nodeName&&e.dom.hasClass(a.target,r)&&(a.name="pagebreak")}))})(e)}))}();
|
!(function () {
|
||||||
|
"use strict";
|
||||||
|
var e = tinymce.util.Tools.resolve("tinymce.PluginManager"),
|
||||||
|
a = tinymce.util.Tools.resolve("tinymce.Env");
|
||||||
|
const t = (e) => (a) => a.options.get(e),
|
||||||
|
n = t("pagebreak_separator"),
|
||||||
|
o = t("pagebreak_split_block"),
|
||||||
|
r = "mce-pagebreak",
|
||||||
|
s = (e) => {
|
||||||
|
const t = `<img src="${a.transparentSrc}" class="${r}" data-mce-resize="false" data-mce-placeholder />`;
|
||||||
|
return e ? `<p>${t}</p>` : t;
|
||||||
|
},
|
||||||
|
c = (e) => (a) => {
|
||||||
|
const t = () => {
|
||||||
|
a.setEnabled(e.selection.isEditable());
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
e.on("NodeChange", t),
|
||||||
|
t(),
|
||||||
|
() => {
|
||||||
|
e.off("NodeChange", t);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
e.add("pagebreak", (e) => {
|
||||||
|
((e) => {
|
||||||
|
const a = e.options.register;
|
||||||
|
a("pagebreak_separator", {
|
||||||
|
processor: "string",
|
||||||
|
default: "\x3c!-- pagebreak --\x3e",
|
||||||
|
}),
|
||||||
|
a("pagebreak_split_block", { processor: "boolean", default: !1 });
|
||||||
|
})(e),
|
||||||
|
((e) => {
|
||||||
|
e.addCommand("mcePageBreak", () => {
|
||||||
|
e.insertContent(s(o(e)));
|
||||||
|
});
|
||||||
|
})(e),
|
||||||
|
((e) => {
|
||||||
|
const a = () => e.execCommand("mcePageBreak");
|
||||||
|
e.ui.registry.addButton("pagebreak", {
|
||||||
|
icon: "page-break",
|
||||||
|
tooltip: "Page break",
|
||||||
|
onAction: a,
|
||||||
|
onSetup: c(e),
|
||||||
|
}),
|
||||||
|
e.ui.registry.addMenuItem("pagebreak", {
|
||||||
|
text: "Page break",
|
||||||
|
icon: "page-break",
|
||||||
|
onAction: a,
|
||||||
|
onSetup: c(e),
|
||||||
|
});
|
||||||
|
})(e),
|
||||||
|
((e) => {
|
||||||
|
const a = n(e),
|
||||||
|
t = () => o(e),
|
||||||
|
c = new RegExp(
|
||||||
|
a.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, (e) => "\\" + e),
|
||||||
|
"gi",
|
||||||
|
);
|
||||||
|
e.on("BeforeSetContent", (e) => {
|
||||||
|
e.content = e.content.replace(c, s(t()));
|
||||||
|
}),
|
||||||
|
e.on("PreInit", () => {
|
||||||
|
e.serializer.addNodeFilter("img", (n) => {
|
||||||
|
let o,
|
||||||
|
s,
|
||||||
|
c = n.length;
|
||||||
|
for (; c--; )
|
||||||
|
if (
|
||||||
|
((o = n[c]), (s = o.attr("class")), s && -1 !== s.indexOf(r))
|
||||||
|
) {
|
||||||
|
const n = o.parent;
|
||||||
|
if (n && e.schema.getBlockElements()[n.name] && t()) {
|
||||||
|
(n.type = 3), (n.value = a), (n.raw = !0), o.remove();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
(o.type = 3), (o.value = a), (o.raw = !0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})(e),
|
||||||
|
((e) => {
|
||||||
|
e.on("ResolveName", (a) => {
|
||||||
|
"IMG" === a.target.nodeName &&
|
||||||
|
e.dom.hasClass(a.target, r) &&
|
||||||
|
(a.name = "pagebreak");
|
||||||
|
});
|
||||||
|
})(e);
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|||||||
@ -1,4 +1,97 @@
|
|||||||
/**
|
/**
|
||||||
* TinyMCE version 6.7.0 (2023-08-30)
|
* TinyMCE version 6.7.0 (2023-08-30)
|
||||||
*/
|
*/
|
||||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=e=>t=>t.options.get(e),i=n("content_style"),s=n("content_css_cors"),c=n("body_class"),r=n("body_id");e.add("preview",(e=>{(e=>{e.addCommand("mcePreview",(()=>{(e=>{const n=(e=>{var n;let l="";const a=e.dom.encode,d=null!==(n=i(e))&&void 0!==n?n:"";l+='<base href="'+a(e.documentBaseURI.getURI())+'">';const m=s(e)?' crossorigin="anonymous"':"";o.each(e.contentCSS,(t=>{l+='<link type="text/css" rel="stylesheet" href="'+a(e.documentBaseURI.toAbsolute(t))+'"'+m+">"})),d&&(l+='<style type="text/css">'+d+"</style>");const y=r(e),u=c(e),v='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(t.os.isMacOS()||t.os.isiOS()?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",p=e.getBody().dir,w=p?' dir="'+a(p)+'"':"";return"<!DOCTYPE html><html><head>"+l+'</head><body id="'+a(y)+'" class="mce-content-body '+a(u)+'"'+w+">"+e.getContent()+v+"</body></html>"})(e);e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0,transparent:!1}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:n}}).focus("close")})(e)}))})(e),(e=>{const t=()=>e.execCommand("mcePreview");e.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:t}),e.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:t})})(e)}))}();
|
!(function () {
|
||||||
|
"use strict";
|
||||||
|
var e = tinymce.util.Tools.resolve("tinymce.PluginManager"),
|
||||||
|
t = tinymce.util.Tools.resolve("tinymce.Env"),
|
||||||
|
o = tinymce.util.Tools.resolve("tinymce.util.Tools");
|
||||||
|
const n = (e) => (t) => t.options.get(e),
|
||||||
|
i = n("content_style"),
|
||||||
|
s = n("content_css_cors"),
|
||||||
|
c = n("body_class"),
|
||||||
|
r = n("body_id");
|
||||||
|
e.add("preview", (e) => {
|
||||||
|
((e) => {
|
||||||
|
e.addCommand("mcePreview", () => {
|
||||||
|
((e) => {
|
||||||
|
const n = ((e) => {
|
||||||
|
var n;
|
||||||
|
let l = "";
|
||||||
|
const a = e.dom.encode,
|
||||||
|
d = null !== (n = i(e)) && void 0 !== n ? n : "";
|
||||||
|
l += '<base href="' + a(e.documentBaseURI.getURI()) + '">';
|
||||||
|
const m = s(e) ? ' crossorigin="anonymous"' : "";
|
||||||
|
o.each(e.contentCSS, (t) => {
|
||||||
|
l +=
|
||||||
|
'<link type="text/css" rel="stylesheet" href="' +
|
||||||
|
a(e.documentBaseURI.toAbsolute(t)) +
|
||||||
|
'"' +
|
||||||
|
m +
|
||||||
|
">";
|
||||||
|
}),
|
||||||
|
d && (l += '<style type="text/css">' + d + "</style>");
|
||||||
|
const y = r(e),
|
||||||
|
u = c(e),
|
||||||
|
v =
|
||||||
|
'<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !(' +
|
||||||
|
(t.os.isMacOS() || t.os.isiOS()
|
||||||
|
? "e.metaKey"
|
||||||
|
: "e.ctrlKey && !e.altKey") +
|
||||||
|
")) {e.preventDefault();}}}, false);</script> ",
|
||||||
|
p = e.getBody().dir,
|
||||||
|
w = p ? ' dir="' + a(p) + '"' : "";
|
||||||
|
return (
|
||||||
|
"<!DOCTYPE html><html><head>" +
|
||||||
|
l +
|
||||||
|
'</head><body id="' +
|
||||||
|
a(y) +
|
||||||
|
'" class="mce-content-body ' +
|
||||||
|
a(u) +
|
||||||
|
'"' +
|
||||||
|
w +
|
||||||
|
">" +
|
||||||
|
e.getContent() +
|
||||||
|
v +
|
||||||
|
"</body></html>"
|
||||||
|
);
|
||||||
|
})(e);
|
||||||
|
e.windowManager
|
||||||
|
.open({
|
||||||
|
title: "Preview",
|
||||||
|
size: "large",
|
||||||
|
body: {
|
||||||
|
type: "panel",
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
name: "preview",
|
||||||
|
type: "iframe",
|
||||||
|
sandboxed: !0,
|
||||||
|
transparent: !1,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
buttons: [
|
||||||
|
{ type: "cancel", name: "close", text: "Close", primary: !0 },
|
||||||
|
],
|
||||||
|
initialData: { preview: n },
|
||||||
|
})
|
||||||
|
.focus("close");
|
||||||
|
})(e);
|
||||||
|
});
|
||||||
|
})(e),
|
||||||
|
((e) => {
|
||||||
|
const t = () => e.execCommand("mcePreview");
|
||||||
|
e.ui.registry.addButton("preview", {
|
||||||
|
icon: "preview",
|
||||||
|
tooltip: "Preview",
|
||||||
|
onAction: t,
|
||||||
|
}),
|
||||||
|
e.ui.registry.addMenuItem("preview", {
|
||||||
|
icon: "preview",
|
||||||
|
text: "Preview",
|
||||||
|
onAction: t,
|
||||||
|
});
|
||||||
|
})(e);
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|||||||
308
src/lib/dist/tinymce/plugins/quickbars/plugin.min.js
vendored
308
src/lib/dist/tinymce/plugins/quickbars/plugin.min.js
vendored
File diff suppressed because one or more lines are too long
74
src/lib/dist/tinymce/plugins/save/plugin.min.js
vendored
74
src/lib/dist/tinymce/plugins/save/plugin.min.js
vendored
@ -1,4 +1,76 @@
|
|||||||
/**
|
/**
|
||||||
* TinyMCE version 6.7.0 (2023-08-30)
|
* TinyMCE version 6.7.0 (2023-08-30)
|
||||||
*/
|
*/
|
||||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const n=("function",e=>"function"==typeof e);var o=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),t=tinymce.util.Tools.resolve("tinymce.util.Tools");const a=e=>n=>n.options.get(e),c=a("save_enablewhendirty"),i=a("save_onsavecallback"),s=a("save_oncancelcallback"),r=(e,n)=>{e.notificationManager.open({text:n,type:"error"})},l=e=>n=>{const o=()=>{n.setEnabled(!c(e)||e.isDirty())};return o(),e.on("NodeChange dirty",o),()=>e.off("NodeChange dirty",o)};e.add("save",(e=>{(e=>{const n=e.options.register;n("save_enablewhendirty",{processor:"boolean",default:!0}),n("save_onsavecallback",{processor:"function"}),n("save_oncancelcallback",{processor:"function"})})(e),(e=>{e.ui.registry.addButton("save",{icon:"save",tooltip:"Save",enabled:!1,onAction:()=>e.execCommand("mceSave"),onSetup:l(e)}),e.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",enabled:!1,onAction:()=>e.execCommand("mceCancel"),onSetup:l(e)}),e.addShortcut("Meta+S","","mceSave")})(e),(e=>{e.addCommand("mceSave",(()=>{(e=>{const t=o.DOM.getParent(e.id,"form");if(c(e)&&!e.isDirty())return;e.save();const a=i(e);if(n(a))return a.call(e,e),void e.nodeChanged();t?(e.setDirty(!1),t.onsubmit&&!t.onsubmit()||("function"==typeof t.submit?t.submit():r(e,"Error: Form submit field collision.")),e.nodeChanged()):r(e,"Error: No form element found.")})(e)})),e.addCommand("mceCancel",(()=>{(e=>{const o=t.trim(e.startContent),a=s(e);n(a)?a.call(e,e):e.resetContent(o)})(e)}))})(e)}))}();
|
!(function () {
|
||||||
|
"use strict";
|
||||||
|
var e = tinymce.util.Tools.resolve("tinymce.PluginManager");
|
||||||
|
const n = ("function", (e) => "function" == typeof e);
|
||||||
|
var o = tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),
|
||||||
|
t = tinymce.util.Tools.resolve("tinymce.util.Tools");
|
||||||
|
const a = (e) => (n) => n.options.get(e),
|
||||||
|
c = a("save_enablewhendirty"),
|
||||||
|
i = a("save_onsavecallback"),
|
||||||
|
s = a("save_oncancelcallback"),
|
||||||
|
r = (e, n) => {
|
||||||
|
e.notificationManager.open({ text: n, type: "error" });
|
||||||
|
},
|
||||||
|
l = (e) => (n) => {
|
||||||
|
const o = () => {
|
||||||
|
n.setEnabled(!c(e) || e.isDirty());
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
o(), e.on("NodeChange dirty", o), () => e.off("NodeChange dirty", o)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
e.add("save", (e) => {
|
||||||
|
((e) => {
|
||||||
|
const n = e.options.register;
|
||||||
|
n("save_enablewhendirty", { processor: "boolean", default: !0 }),
|
||||||
|
n("save_onsavecallback", { processor: "function" }),
|
||||||
|
n("save_oncancelcallback", { processor: "function" });
|
||||||
|
})(e),
|
||||||
|
((e) => {
|
||||||
|
e.ui.registry.addButton("save", {
|
||||||
|
icon: "save",
|
||||||
|
tooltip: "Save",
|
||||||
|
enabled: !1,
|
||||||
|
onAction: () => e.execCommand("mceSave"),
|
||||||
|
onSetup: l(e),
|
||||||
|
}),
|
||||||
|
e.ui.registry.addButton("cancel", {
|
||||||
|
icon: "cancel",
|
||||||
|
tooltip: "Cancel",
|
||||||
|
enabled: !1,
|
||||||
|
onAction: () => e.execCommand("mceCancel"),
|
||||||
|
onSetup: l(e),
|
||||||
|
}),
|
||||||
|
e.addShortcut("Meta+S", "", "mceSave");
|
||||||
|
})(e),
|
||||||
|
((e) => {
|
||||||
|
e.addCommand("mceSave", () => {
|
||||||
|
((e) => {
|
||||||
|
const t = o.DOM.getParent(e.id, "form");
|
||||||
|
if (c(e) && !e.isDirty()) return;
|
||||||
|
e.save();
|
||||||
|
const a = i(e);
|
||||||
|
if (n(a)) return a.call(e, e), void e.nodeChanged();
|
||||||
|
t
|
||||||
|
? (e.setDirty(!1),
|
||||||
|
(t.onsubmit && !t.onsubmit()) ||
|
||||||
|
("function" == typeof t.submit
|
||||||
|
? t.submit()
|
||||||
|
: r(e, "Error: Form submit field collision.")),
|
||||||
|
e.nodeChanged())
|
||||||
|
: r(e, "Error: No form element found.");
|
||||||
|
})(e);
|
||||||
|
}),
|
||||||
|
e.addCommand("mceCancel", () => {
|
||||||
|
((e) => {
|
||||||
|
const o = t.trim(e.startContent),
|
||||||
|
a = s(e);
|
||||||
|
n(a) ? a.call(e, e) : e.resetContent(o);
|
||||||
|
})(e);
|
||||||
|
});
|
||||||
|
})(e);
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
2790
src/lib/dist/tinymce/plugins/table/plugin.min.js
vendored
2790
src/lib/dist/tinymce/plugins/table/plugin.min.js
vendored
File diff suppressed because one or more lines are too long
490
src/lib/dist/tinymce/plugins/template/plugin.min.js
vendored
490
src/lib/dist/tinymce/plugins/template/plugin.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,4 +1,72 @@
|
|||||||
/**
|
/**
|
||||||
* TinyMCE version 6.7.0 (2023-08-30)
|
* TinyMCE version 6.7.0 (2023-08-30)
|
||||||
*/
|
*/
|
||||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const s=(t,s,o)=>{t.dom.toggleClass(t.getBody(),"mce-visualblocks"),o.set(!o.get()),((t,s)=>{t.dispatch("VisualBlocks",{state:s})})(t,o.get())},o=("visualblocks_default_state",t=>t.options.get("visualblocks_default_state"));const e=(t,s)=>o=>{o.setActive(s.get());const e=t=>o.setActive(t.state);return t.on("VisualBlocks",e),()=>t.off("VisualBlocks",e)};t.add("visualblocks",((t,l)=>{(t=>{(0,t.options.register)("visualblocks_default_state",{processor:"boolean",default:!1})})(t);const a=(t=>{let s=!1;return{get:()=>s,set:t=>{s=t}}})();((t,o,e)=>{t.addCommand("mceVisualBlocks",(()=>{s(t,0,e)}))})(t,0,a),((t,s)=>{const o=()=>t.execCommand("mceVisualBlocks");t.ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:o,onSetup:e(t,s)}),t.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",icon:"visualblocks",onAction:o,onSetup:e(t,s)})})(t,a),((t,e,l)=>{t.on("PreviewFormats AfterPreviewFormats",(s=>{l.get()&&t.dom.toggleClass(t.getBody(),"mce-visualblocks","afterpreviewformats"===s.type)})),t.on("init",(()=>{o(t)&&s(t,0,l)}))})(t,0,a)}))}();
|
!(function () {
|
||||||
|
"use strict";
|
||||||
|
var t = tinymce.util.Tools.resolve("tinymce.PluginManager");
|
||||||
|
const s = (t, s, o) => {
|
||||||
|
t.dom.toggleClass(t.getBody(), "mce-visualblocks"),
|
||||||
|
o.set(!o.get()),
|
||||||
|
((t, s) => {
|
||||||
|
t.dispatch("VisualBlocks", { state: s });
|
||||||
|
})(t, o.get());
|
||||||
|
},
|
||||||
|
o =
|
||||||
|
("visualblocks_default_state",
|
||||||
|
(t) => t.options.get("visualblocks_default_state"));
|
||||||
|
const e = (t, s) => (o) => {
|
||||||
|
o.setActive(s.get());
|
||||||
|
const e = (t) => o.setActive(t.state);
|
||||||
|
return t.on("VisualBlocks", e), () => t.off("VisualBlocks", e);
|
||||||
|
};
|
||||||
|
t.add("visualblocks", (t, l) => {
|
||||||
|
((t) => {
|
||||||
|
(0, t.options.register)("visualblocks_default_state", {
|
||||||
|
processor: "boolean",
|
||||||
|
default: !1,
|
||||||
|
});
|
||||||
|
})(t);
|
||||||
|
const a = ((t) => {
|
||||||
|
let s = !1;
|
||||||
|
return {
|
||||||
|
get: () => s,
|
||||||
|
set: (t) => {
|
||||||
|
s = t;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
((t, o, e) => {
|
||||||
|
t.addCommand("mceVisualBlocks", () => {
|
||||||
|
s(t, 0, e);
|
||||||
|
});
|
||||||
|
})(t, 0, a),
|
||||||
|
((t, s) => {
|
||||||
|
const o = () => t.execCommand("mceVisualBlocks");
|
||||||
|
t.ui.registry.addToggleButton("visualblocks", {
|
||||||
|
icon: "visualblocks",
|
||||||
|
tooltip: "Show blocks",
|
||||||
|
onAction: o,
|
||||||
|
onSetup: e(t, s),
|
||||||
|
}),
|
||||||
|
t.ui.registry.addToggleMenuItem("visualblocks", {
|
||||||
|
text: "Show blocks",
|
||||||
|
icon: "visualblocks",
|
||||||
|
onAction: o,
|
||||||
|
onSetup: e(t, s),
|
||||||
|
});
|
||||||
|
})(t, a),
|
||||||
|
((t, e, l) => {
|
||||||
|
t.on("PreviewFormats AfterPreviewFormats", (s) => {
|
||||||
|
l.get() &&
|
||||||
|
t.dom.toggleClass(
|
||||||
|
t.getBody(),
|
||||||
|
"mce-visualblocks",
|
||||||
|
"afterpreviewformats" === s.type,
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
t.on("init", () => {
|
||||||
|
o(t) && s(t, 0, l);
|
||||||
|
});
|
||||||
|
})(t, 0, a);
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
306
src/lib/dist/tinymce/plugins/wordcount/plugin.min.js
vendored
306
src/lib/dist/tinymce/plugins/wordcount/plugin.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1 +1,60 @@
|
|||||||
body{background-color:#222f3e;color:#fff;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}a{color:#4099ff}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#6d737b}figure{display:table;margin:1rem auto}figure figcaption{color:#8a8f97;display:block;margin-top:.25rem;text-align:center}hr{border-color:#6d737b;border-style:solid;border-width:1px 0 0 0}code{background-color:#6d737b;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #6d737b;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #6d737b;margin-right:1.5rem;padding-right:1rem}
|
body {
|
||||||
|
background-color: #222f3e;
|
||||||
|
color: #fff;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
|
||||||
|
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
||||||
|
line-height: 1.4;
|
||||||
|
margin: 1rem;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: #4099ff;
|
||||||
|
}
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
table:not([cellpadding]) td,
|
||||||
|
table:not([cellpadding]) th {
|
||||||
|
padding: 0.4rem;
|
||||||
|
}
|
||||||
|
table[border]:not([border="0"]):not([style*="border-width"]) td,
|
||||||
|
table[border]:not([border="0"]):not([style*="border-width"]) th {
|
||||||
|
border-width: 1px;
|
||||||
|
}
|
||||||
|
table[border]:not([border="0"]):not([style*="border-style"]) td,
|
||||||
|
table[border]:not([border="0"]):not([style*="border-style"]) th {
|
||||||
|
border-style: solid;
|
||||||
|
}
|
||||||
|
table[border]:not([border="0"]):not([style*="border-color"]) td,
|
||||||
|
table[border]:not([border="0"]):not([style*="border-color"]) th {
|
||||||
|
border-color: #6d737b;
|
||||||
|
}
|
||||||
|
figure {
|
||||||
|
display: table;
|
||||||
|
margin: 1rem auto;
|
||||||
|
}
|
||||||
|
figure figcaption {
|
||||||
|
color: #8a8f97;
|
||||||
|
display: block;
|
||||||
|
margin-top: 0.25rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
hr {
|
||||||
|
border-color: #6d737b;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px 0 0 0;
|
||||||
|
}
|
||||||
|
code {
|
||||||
|
background-color: #6d737b;
|
||||||
|
border-radius: 3px;
|
||||||
|
padding: 0.1rem 0.2rem;
|
||||||
|
}
|
||||||
|
.mce-content-body:not([dir="rtl"]) blockquote {
|
||||||
|
border-left: 2px solid #6d737b;
|
||||||
|
margin-left: 1.5rem;
|
||||||
|
padding-left: 1rem;
|
||||||
|
}
|
||||||
|
.mce-content-body[dir="rtl"] blockquote {
|
||||||
|
border-right: 2px solid #6d737b;
|
||||||
|
margin-right: 1.5rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
}
|
||||||
|
|||||||
@ -1 +1,55 @@
|
|||||||
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
|
||||||
|
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
||||||
|
line-height: 1.4;
|
||||||
|
margin: 1rem;
|
||||||
|
}
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
table:not([cellpadding]) td,
|
||||||
|
table:not([cellpadding]) th {
|
||||||
|
padding: 0.4rem;
|
||||||
|
}
|
||||||
|
table[border]:not([border="0"]):not([style*="border-width"]) td,
|
||||||
|
table[border]:not([border="0"]):not([style*="border-width"]) th {
|
||||||
|
border-width: 1px;
|
||||||
|
}
|
||||||
|
table[border]:not([border="0"]):not([style*="border-style"]) td,
|
||||||
|
table[border]:not([border="0"]):not([style*="border-style"]) th {
|
||||||
|
border-style: solid;
|
||||||
|
}
|
||||||
|
table[border]:not([border="0"]):not([style*="border-color"]) td,
|
||||||
|
table[border]:not([border="0"]):not([style*="border-color"]) th {
|
||||||
|
border-color: #ccc;
|
||||||
|
}
|
||||||
|
figure {
|
||||||
|
display: table;
|
||||||
|
margin: 1rem auto;
|
||||||
|
}
|
||||||
|
figure figcaption {
|
||||||
|
color: #999;
|
||||||
|
display: block;
|
||||||
|
margin-top: 0.25rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
hr {
|
||||||
|
border-color: #ccc;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px 0 0 0;
|
||||||
|
}
|
||||||
|
code {
|
||||||
|
background-color: #e8e8e8;
|
||||||
|
border-radius: 3px;
|
||||||
|
padding: 0.1rem 0.2rem;
|
||||||
|
}
|
||||||
|
.mce-content-body:not([dir="rtl"]) blockquote {
|
||||||
|
border-left: 2px solid #ccc;
|
||||||
|
margin-left: 1.5rem;
|
||||||
|
padding-left: 1rem;
|
||||||
|
}
|
||||||
|
.mce-content-body[dir="rtl"] blockquote {
|
||||||
|
border-right: 2px solid #ccc;
|
||||||
|
margin-right: 1.5rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
}
|
||||||
|
|||||||
@ -1 +1,60 @@
|
|||||||
@media screen{html{background:#f4f4f4;min-height:100%}}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif}@media screen{body{background-color:#fff;box-shadow:0 0 4px rgba(0,0,0,.15);box-sizing:border-box;margin:1rem auto 0;max-width:820px;min-height:calc(100vh - 1rem);padding:4rem 6rem 6rem 6rem}}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure figcaption{color:#999;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}
|
@media screen {
|
||||||
|
html {
|
||||||
|
background: #f4f4f4;
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
|
||||||
|
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
||||||
|
}
|
||||||
|
@media screen {
|
||||||
|
body {
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin: 1rem auto 0;
|
||||||
|
max-width: 820px;
|
||||||
|
min-height: calc(100vh - 1rem);
|
||||||
|
padding: 4rem 6rem 6rem 6rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
table:not([cellpadding]) td,
|
||||||
|
table:not([cellpadding]) th {
|
||||||
|
padding: 0.4rem;
|
||||||
|
}
|
||||||
|
table[border]:not([border="0"]):not([style*="border-width"]) td,
|
||||||
|
table[border]:not([border="0"]):not([style*="border-width"]) th {
|
||||||
|
border-width: 1px;
|
||||||
|
}
|
||||||
|
table[border]:not([border="0"]):not([style*="border-style"]) td,
|
||||||
|
table[border]:not([border="0"]):not([style*="border-style"]) th {
|
||||||
|
border-style: solid;
|
||||||
|
}
|
||||||
|
table[border]:not([border="0"]):not([style*="border-color"]) td,
|
||||||
|
table[border]:not([border="0"]):not([style*="border-color"]) th {
|
||||||
|
border-color: #ccc;
|
||||||
|
}
|
||||||
|
figure figcaption {
|
||||||
|
color: #999;
|
||||||
|
margin-top: 0.25rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
hr {
|
||||||
|
border-color: #ccc;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px 0 0 0;
|
||||||
|
}
|
||||||
|
.mce-content-body:not([dir="rtl"]) blockquote {
|
||||||
|
border-left: 2px solid #ccc;
|
||||||
|
margin-left: 1.5rem;
|
||||||
|
padding-left: 1rem;
|
||||||
|
}
|
||||||
|
.mce-content-body[dir="rtl"] blockquote {
|
||||||
|
border-right: 2px solid #ccc;
|
||||||
|
margin-right: 1.5rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
body {
|
body {
|
||||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
|
||||||
|
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
margin: 1rem;
|
margin: 1rem;
|
||||||
}
|
}
|
||||||
@ -31,12 +32,12 @@ code {
|
|||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: 0.1rem 0.2rem;
|
padding: 0.1rem 0.2rem;
|
||||||
}
|
}
|
||||||
.mce-content-body:not([dir=rtl]) blockquote {
|
.mce-content-body:not([dir="rtl"]) blockquote {
|
||||||
border-left: 2px solid #ccc;
|
border-left: 2px solid #ccc;
|
||||||
margin-left: 1.5rem;
|
margin-left: 1.5rem;
|
||||||
padding-left: 1rem;
|
padding-left: 1rem;
|
||||||
}
|
}
|
||||||
.mce-content-body[dir=rtl] blockquote {
|
.mce-content-body[dir="rtl"] blockquote {
|
||||||
border-right: 2px solid #ccc;
|
border-right: 2px solid #ccc;
|
||||||
margin-right: 1.5rem;
|
margin-right: 1.5rem;
|
||||||
padding-right: 1rem;
|
padding-right: 1rem;
|
||||||
|
|||||||
@ -1 +1,44 @@
|
|||||||
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table td,table th{border:1px solid #ccc;padding:.4rem}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
|
||||||
|
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
||||||
|
line-height: 1.4;
|
||||||
|
margin: 1rem;
|
||||||
|
}
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
table td,
|
||||||
|
table th {
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
padding: 0.4rem;
|
||||||
|
}
|
||||||
|
figure {
|
||||||
|
display: table;
|
||||||
|
margin: 1rem auto;
|
||||||
|
}
|
||||||
|
figure figcaption {
|
||||||
|
color: #999;
|
||||||
|
display: block;
|
||||||
|
margin-top: 0.25rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
hr {
|
||||||
|
border-color: #ccc;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px 0 0 0;
|
||||||
|
}
|
||||||
|
code {
|
||||||
|
background-color: #e8e8e8;
|
||||||
|
border-radius: 3px;
|
||||||
|
padding: 0.1rem 0.2rem;
|
||||||
|
}
|
||||||
|
.mce-content-body:not([dir="rtl"]) blockquote {
|
||||||
|
border-left: 2px solid #ccc;
|
||||||
|
margin-left: 1.5rem;
|
||||||
|
padding-left: 1rem;
|
||||||
|
}
|
||||||
|
.mce-content-body[dir="rtl"] blockquote {
|
||||||
|
border-right: 2px solid #ccc;
|
||||||
|
margin-right: 1.5rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
}
|
||||||
|
|||||||
@ -1 +1,56 @@
|
|||||||
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem auto;max-width:900px}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
|
||||||
|
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
||||||
|
line-height: 1.4;
|
||||||
|
margin: 1rem auto;
|
||||||
|
max-width: 900px;
|
||||||
|
}
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
table:not([cellpadding]) td,
|
||||||
|
table:not([cellpadding]) th {
|
||||||
|
padding: 0.4rem;
|
||||||
|
}
|
||||||
|
table[border]:not([border="0"]):not([style*="border-width"]) td,
|
||||||
|
table[border]:not([border="0"]):not([style*="border-width"]) th {
|
||||||
|
border-width: 1px;
|
||||||
|
}
|
||||||
|
table[border]:not([border="0"]):not([style*="border-style"]) td,
|
||||||
|
table[border]:not([border="0"]):not([style*="border-style"]) th {
|
||||||
|
border-style: solid;
|
||||||
|
}
|
||||||
|
table[border]:not([border="0"]):not([style*="border-color"]) td,
|
||||||
|
table[border]:not([border="0"]):not([style*="border-color"]) th {
|
||||||
|
border-color: #ccc;
|
||||||
|
}
|
||||||
|
figure {
|
||||||
|
display: table;
|
||||||
|
margin: 1rem auto;
|
||||||
|
}
|
||||||
|
figure figcaption {
|
||||||
|
color: #999;
|
||||||
|
display: block;
|
||||||
|
margin-top: 0.25rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
hr {
|
||||||
|
border-color: #ccc;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px 0 0 0;
|
||||||
|
}
|
||||||
|
code {
|
||||||
|
background-color: #e8e8e8;
|
||||||
|
border-radius: 3px;
|
||||||
|
padding: 0.1rem 0.2rem;
|
||||||
|
}
|
||||||
|
.mce-content-body:not([dir="rtl"]) blockquote {
|
||||||
|
border-left: 2px solid #ccc;
|
||||||
|
margin-left: 1.5rem;
|
||||||
|
padding-left: 1rem;
|
||||||
|
}
|
||||||
|
.mce-content-body[dir="rtl"] blockquote {
|
||||||
|
border-right: 2px solid #ccc;
|
||||||
|
margin-right: 1.5rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
803
src/lib/dist/tinymce/skins/ui/oxide/content.min.css
vendored
803
src/lib/dist/tinymce/skins/ui/oxide/content.min.css
vendored
File diff suppressed because one or more lines are too long
4031
src/lib/dist/tinymce/skins/ui/oxide/skin.min.css
vendored
4031
src/lib/dist/tinymce/skins/ui/oxide/skin.min.css
vendored
File diff suppressed because one or more lines are too long
@ -1 +1,30 @@
|
|||||||
body.tox-dialog__disable-scroll{overflow:hidden}.tox-fullscreen{border:0;height:100%;margin:0;overflow:hidden;overscroll-behavior:none;padding:0;touch-action:pinch-zoom;width:100%}.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox-shadowhost.tox-fullscreen,.tox.tox-tinymce.tox-fullscreen{left:0;position:fixed;top:0;z-index:1200}.tox.tox-tinymce.tox-fullscreen{background-color:transparent}.tox-fullscreen .tox.tox-tinymce-aux,.tox-fullscreen~.tox.tox-tinymce-aux{z-index:1201}
|
body.tox-dialog__disable-scroll {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.tox-fullscreen {
|
||||||
|
border: 0;
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
overscroll-behavior: none;
|
||||||
|
padding: 0;
|
||||||
|
touch-action: pinch-zoom;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.tox-shadowhost.tox-fullscreen,
|
||||||
|
.tox.tox-tinymce.tox-fullscreen {
|
||||||
|
left: 0;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
z-index: 1200;
|
||||||
|
}
|
||||||
|
.tox.tox-tinymce.tox-fullscreen {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
.tox-fullscreen .tox.tox-tinymce-aux,
|
||||||
|
.tox-fullscreen ~ .tox.tox-tinymce-aux {
|
||||||
|
z-index: 1201;
|
||||||
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4031
src/lib/dist/tinymce/skins/ui/stocknear/skin.min.css
vendored
4031
src/lib/dist/tinymce/skins/ui/stocknear/skin.min.css
vendored
File diff suppressed because one or more lines are too long
@ -1 +1,30 @@
|
|||||||
body.tox-dialog__disable-scroll{overflow:hidden}.tox-fullscreen{border:0;height:100%;margin:0;overflow:hidden;overscroll-behavior:none;padding:0;touch-action:pinch-zoom;width:100%}.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox-shadowhost.tox-fullscreen,.tox.tox-tinymce.tox-fullscreen{left:0;position:fixed;top:0;z-index:1200}.tox.tox-tinymce.tox-fullscreen{background-color:transparent}.tox-fullscreen .tox.tox-tinymce-aux,.tox-fullscreen~.tox.tox-tinymce-aux{z-index:1201}
|
body.tox-dialog__disable-scroll {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.tox-fullscreen {
|
||||||
|
border: 0;
|
||||||
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
overscroll-behavior: none;
|
||||||
|
padding: 0;
|
||||||
|
touch-action: pinch-zoom;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.tox-shadowhost.tox-fullscreen,
|
||||||
|
.tox.tox-tinymce.tox-fullscreen {
|
||||||
|
left: 0;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
z-index: 1200;
|
||||||
|
}
|
||||||
|
.tox.tox-tinymce.tox-fullscreen {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
.tox-fullscreen .tox.tox-tinymce-aux,
|
||||||
|
.tox-fullscreen ~ .tox.tox-tinymce-aux {
|
||||||
|
z-index: 1201;
|
||||||
|
}
|
||||||
|
|||||||
25929
src/lib/dist/tinymce/themes/silver/theme.min.js
vendored
25929
src/lib/dist/tinymce/themes/silver/theme.min.js
vendored
File diff suppressed because one or more lines are too long
25627
src/lib/dist/tinymce/tinymce.min.js
vendored
25627
src/lib/dist/tinymce/tinymce.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,34 +1,34 @@
|
|||||||
import { browser } from "$app/environment";
|
import { browser } from "$app/environment";
|
||||||
|
|
||||||
const windowWithLemonSqueezy = browser
|
const windowWithLemonSqueezy = browser
|
||||||
? (window as unknown as {
|
? (window as unknown as {
|
||||||
LemonSqueezy: any;
|
LemonSqueezy: any;
|
||||||
createLemonSqueezy: () => void;
|
createLemonSqueezy: () => void;
|
||||||
})
|
})
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
export async function openLemonSqueezyUrl(s: string) {
|
export async function openLemonSqueezyUrl(s: string) {
|
||||||
const LemonSqueezy = await getLemonSqueezy();
|
const LemonSqueezy = await getLemonSqueezy();
|
||||||
return LemonSqueezy.Url.Open(s);
|
return LemonSqueezy.Url.Open(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getLemonSqueezy() {
|
async function getLemonSqueezy() {
|
||||||
if (!windowWithLemonSqueezy?.LemonSqueezy) {
|
if (!windowWithLemonSqueezy?.LemonSqueezy) {
|
||||||
await loadAndInitialize();
|
await loadAndInitialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
return windowWithLemonSqueezy?.LemonSqueezy;
|
return windowWithLemonSqueezy?.LemonSqueezy;
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadAndInitialize() {
|
function loadAndInitialize() {
|
||||||
return new Promise<void>((resolve) => {
|
return new Promise<void>((resolve) => {
|
||||||
const script = document.createElement("script");
|
const script = document.createElement("script");
|
||||||
script.onload = function () {
|
script.onload = function () {
|
||||||
windowWithLemonSqueezy?.createLemonSqueezy();
|
windowWithLemonSqueezy?.createLemonSqueezy();
|
||||||
resolve();
|
resolve();
|
||||||
};
|
};
|
||||||
script.src = "https://assets.lemonsqueezy.com/lemon.js";
|
script.src = "https://assets.lemonsqueezy.com/lemon.js";
|
||||||
|
|
||||||
document.head.appendChild(script);
|
document.head.appendChild(script);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1,17 +1,16 @@
|
|||||||
import PocketBase from 'pocketbase';
|
import PocketBase from "pocketbase";
|
||||||
import { userRegion } from '$lib/store';
|
import { userRegion } from "$lib/store";
|
||||||
|
|
||||||
const usRegion = ['cle1','iad1','pdx1','sfo1'];
|
const usRegion = ["cle1", "iad1", "pdx1", "sfo1"];
|
||||||
|
|
||||||
let pbUrl;
|
let pbUrl;
|
||||||
|
|
||||||
userRegion.subscribe(value => {
|
userRegion.subscribe((value) => {
|
||||||
|
if (usRegion?.includes(value)) {
|
||||||
if (usRegion?.includes(value)) {
|
pbUrl = import.meta.env.VITE_USEAST_POCKETBASE_URL;
|
||||||
pbUrl = import.meta.env.VITE_USEAST_POCKETBASE_URL;
|
} else {
|
||||||
} else {
|
pbUrl = import.meta.env.VITE_EU_POCKETBASE_URL;
|
||||||
pbUrl = import.meta.env.VITE_EU_POCKETBASE_URL;
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
|
||||||
export const pb = new PocketBase(pbUrl);
|
export const pb = new PocketBase(pbUrl);
|
||||||
|
|||||||
@ -1,133 +1,140 @@
|
|||||||
import { z } from 'zod';
|
import { z } from "zod";
|
||||||
|
|
||||||
export const loginUserSchema = z.object({
|
export const loginUserSchema = z.object({
|
||||||
email: z
|
email: z
|
||||||
.string({ required_error: 'Email is required' })
|
.string({ required_error: "Email is required" })
|
||||||
.email({ message: 'Email must be a valid email.' }),
|
.email({ message: "Email must be a valid email." }),
|
||||||
password: z.string({ required_error: 'Password is required' })
|
password: z.string({ required_error: "Password is required" }),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const registerUserSchema = z
|
export const registerUserSchema = z
|
||||||
.object({
|
.object({
|
||||||
username: z
|
username: z
|
||||||
.string({ required_error: 'Username is required' })
|
.string({ required_error: "Username is required" })
|
||||||
.regex(/^[a-zA-Z0-9!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]*$/, { message: 'Username can only contain letters, numbers, and special characters.' }) // Updated regex pattern
|
.regex(/^[a-zA-Z0-9!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]*$/, {
|
||||||
.min(3, { message: 'Username must be at least 2 characters' })
|
message:
|
||||||
.max(64, { message: 'Username must be less than 64 characters' })
|
"Username can only contain letters, numbers, and special characters.",
|
||||||
.trim(),
|
}) // Updated regex pattern
|
||||||
email: z
|
.min(3, { message: "Username must be at least 2 characters" })
|
||||||
.string({ required_error: 'Email is required' })
|
.max(64, { message: "Username must be less than 64 characters" })
|
||||||
.email({ message: 'Email must be a valid email' }),
|
.trim(),
|
||||||
password: z
|
email: z
|
||||||
.string({ required_error: 'Password is required' })
|
.string({ required_error: "Email is required" })
|
||||||
.regex(/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&+\-,.\[\]{};':"\\|/=\(\)\^_*]{8,}$/, {
|
.email({ message: "Email must be a valid email" }),
|
||||||
message:
|
password: z
|
||||||
'Password must be a minimum of 8 characters & contain at least one letter, one number, and one special character.'
|
.string({ required_error: "Password is required" })
|
||||||
}),
|
.regex(
|
||||||
passwordConfirm: z
|
/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&+\-,.\[\]{};':"\\|/=\(\)\^_*]{8,}$/,
|
||||||
.string({ required_error: 'Confirm Password is required' })
|
{
|
||||||
.regex(/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&+\-,.\[\]{};':"\\|/=\(\)\^_*]{8,}$/, {
|
message:
|
||||||
message:
|
"Password must be a minimum of 8 characters & contain at least one letter, one number, and one special character.",
|
||||||
'Password must be a minimum of 8 characters & contain at least one letter, one number, and one special character.'
|
},
|
||||||
})
|
),
|
||||||
})
|
passwordConfirm: z
|
||||||
.superRefine(({ passwordConfirm, password }, ctx) => {
|
.string({ required_error: "Confirm Password is required" })
|
||||||
if (passwordConfirm !== password) {
|
.regex(
|
||||||
ctx.addIssue({
|
/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&+\-,.\[\]{};':"\\|/=\(\)\^_*]{8,}$/,
|
||||||
code: z.ZodIssueCode.custom,
|
{
|
||||||
message: 'Password & Confirm password must match',
|
message:
|
||||||
path: ['password']
|
"Password must be a minimum of 8 characters & contain at least one letter, one number, and one special character.",
|
||||||
});
|
},
|
||||||
ctx.addIssue({
|
),
|
||||||
code: z.ZodIssueCode.custom,
|
})
|
||||||
message: 'Password & Confirm password must match',
|
.superRefine(({ passwordConfirm, password }, ctx) => {
|
||||||
path: ['passwordConfirm']
|
if (passwordConfirm !== password) {
|
||||||
});
|
ctx.addIssue({
|
||||||
}
|
code: z.ZodIssueCode.custom,
|
||||||
});
|
message: "Password & Confirm password must match",
|
||||||
|
path: ["password"],
|
||||||
|
});
|
||||||
|
ctx.addIssue({
|
||||||
|
code: z.ZodIssueCode.custom,
|
||||||
|
message: "Password & Confirm password must match",
|
||||||
|
path: ["passwordConfirm"],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
export const createPostTextSchema = z.object({
|
export const createPostTextSchema = z.object({
|
||||||
title: z
|
title: z
|
||||||
.string({ required_error: 'Title is required' })
|
.string({ required_error: "Title is required" })
|
||||||
.min(1, { message: 'Title is required' })
|
.min(1, { message: "Title is required" })
|
||||||
.max(300, { message: 'Title must be 300 characters or less' })
|
.max(300, { message: "Title must be 300 characters or less" })
|
||||||
.trim(),
|
.trim(),
|
||||||
|
|
||||||
//url: z.string().optional().url({ message: 'URL must be a valid URL' }),
|
//url: z.string().optional().url({ message: 'URL must be a valid URL' }),
|
||||||
tagline: z.string(),
|
tagline: z.string(),
|
||||||
tagTopic: z.string(),
|
tagTopic: z.string(),
|
||||||
atLeastOneTag: z.string({ required_error: 'At least 1 tag is required' })
|
atLeastOneTag: z
|
||||||
.min(1, { message: 'At least 1 tag is required' }),
|
.string({ required_error: "At least 1 tag is required" })
|
||||||
description: z.string(),
|
.min(1, { message: "At least 1 tag is required" }),
|
||||||
postType: z.string({ required_error: 'PostType is required.' }),
|
description: z.string(),
|
||||||
user: z.string({ required_error: 'User is required.' }),
|
postType: z.string({ required_error: "PostType is required." }),
|
||||||
|
user: z.string({ required_error: "User is required." }),
|
||||||
});
|
});
|
||||||
|
|
||||||
const imageTypes = [
|
const imageTypes = [
|
||||||
'image/jpeg',
|
"image/jpeg",
|
||||||
'image/jpg',
|
"image/jpg",
|
||||||
'image/png',
|
"image/png",
|
||||||
'image/webp',
|
"image/webp",
|
||||||
'image/svg+xml',
|
"image/svg+xml",
|
||||||
'image/gif'
|
"image/gif",
|
||||||
];
|
];
|
||||||
|
|
||||||
const videoTypes = ['video/mp4', 'video/gif'];
|
const videoTypes = ["video/mp4", "video/gif"];
|
||||||
|
|
||||||
export const createPostImageSchema = z.object({
|
export const createPostImageSchema = z.object({
|
||||||
title: z
|
title: z
|
||||||
.string({ required_error: 'Title is required' })
|
.string({ required_error: "Title is required" })
|
||||||
.min(1, { message: 'Title is required' })
|
.min(1, { message: "Title is required" })
|
||||||
.max(300, { message: 'Title must be 300 characters or less' })
|
.max(300, { message: "Title must be 300 characters or less" })
|
||||||
.trim(),
|
.trim(),
|
||||||
tagTopic: z.string(),
|
tagTopic: z.string(),
|
||||||
tagline: z.string(),
|
tagline: z.string(),
|
||||||
atLeastOneTag: z.string({ required_error: 'At least 1 tag is required' }).min(1, { message: 'At least 1 tag is required' }),
|
atLeastOneTag: z
|
||||||
thumbnail: z
|
.string({ required_error: "At least 1 tag is required" })
|
||||||
.instanceof(File)
|
.min(1, { message: "At least 1 tag is required" }),
|
||||||
.superRefine((val, ctx) => {
|
thumbnail: z.instanceof(File).superRefine((val, ctx) => {
|
||||||
if (val) {
|
if (val) {
|
||||||
if (val.size > 5121440) {
|
if (val.size > 5121440) {
|
||||||
ctx.addIssue({
|
ctx.addIssue({
|
||||||
code: z.ZodIssueCode.custom,
|
code: z.ZodIssueCode.custom,
|
||||||
message: 'File must be less than 5MB',
|
message: "File must be less than 5MB",
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
val.type &&
|
|
||||||
!imageTypes.includes(val.type) &&
|
|
||||||
!videoTypes.includes(val.type)
|
|
||||||
) {
|
|
||||||
ctx.addIssue({
|
|
||||||
code: z.ZodIssueCode.custom,
|
|
||||||
message:
|
|
||||||
'Unsupported file type. Supported formats: jpeg, jpg, png, webp, svg',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}),
|
|
||||||
postType: z.string({ required_error: 'PostType is required.' }),
|
if (
|
||||||
user: z.string({ required_error: 'User is required.' }),
|
val.type &&
|
||||||
|
!imageTypes.includes(val.type) &&
|
||||||
|
!videoTypes.includes(val.type)
|
||||||
|
) {
|
||||||
|
ctx.addIssue({
|
||||||
|
code: z.ZodIssueCode.custom,
|
||||||
|
message:
|
||||||
|
"Unsupported file type. Supported formats: jpeg, jpg, png, webp, svg",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
postType: z.string({ required_error: "PostType is required." }),
|
||||||
|
user: z.string({ required_error: "User is required." }),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const createPostLinkSchema = z.object({
|
export const createPostLinkSchema = z.object({
|
||||||
title: z
|
title: z
|
||||||
.string({ required_error: 'Title is required' })
|
.string({ required_error: "Title is required" })
|
||||||
.min(1, { message: 'Title is required' })
|
.min(1, { message: "Title is required" })
|
||||||
.max(300, { message: 'Title must be 300 characters or less' })
|
.max(300, { message: "Title must be 300 characters or less" })
|
||||||
.trim(),
|
.trim(),
|
||||||
tagTopic: z.string(),
|
tagTopic: z.string(),
|
||||||
tagline: z.string(),
|
tagline: z.string(),
|
||||||
atLeastOneTag: z.string({ required_error: 'At least 1 tag is required' })
|
atLeastOneTag: z
|
||||||
.min(1, { message: 'At least 1 tag is required' }),
|
.string({ required_error: "At least 1 tag is required" })
|
||||||
link: z.string().url({ message: 'URL must be a valid URL' }),
|
.min(1, { message: "At least 1 tag is required" }),
|
||||||
description: z.string(),
|
link: z.string().url({ message: "URL must be a valid URL" }),
|
||||||
/*
|
description: z.string(),
|
||||||
|
/*
|
||||||
thumbnail: z
|
thumbnail: z
|
||||||
.instanceof(Blob)
|
.instanceof(Blob)
|
||||||
.superRefine((val, ctx) => {
|
.superRefine((val, ctx) => {
|
||||||
@ -148,265 +155,240 @@ export const createPostLinkSchema = z.object({
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
*/
|
*/
|
||||||
postType: z.string({ required_error: 'PostType is required.' }),
|
postType: z.string({ required_error: "PostType is required." }),
|
||||||
user: z.string({ required_error: 'User is required.' }),
|
user: z.string({ required_error: "User is required." }),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//export const updatePostSchema = createPostSchema.omit({ user: true });
|
//export const updatePostSchema = createPostSchema.omit({ user: true });
|
||||||
|
|
||||||
|
|
||||||
export const updatePersonalDataSchema = z.object({
|
export const updatePersonalDataSchema = z.object({
|
||||||
/*
|
/*
|
||||||
email: z
|
email: z
|
||||||
.string({ required_error: 'Email is required' })
|
.string({ required_error: 'Email is required' })
|
||||||
.email({ message: 'Email must be a valid email' }),
|
.email({ message: 'Email must be a valid email' }),
|
||||||
*/
|
*/
|
||||||
username: z
|
username: z
|
||||||
.string({ required_error: 'Username is required' })
|
.string({ required_error: "Username is required" })
|
||||||
.min(2, { message: 'Username must be at least 2 characters' })
|
.min(2, { message: "Username must be at least 2 characters" })
|
||||||
.max(24, { message: 'Username must be 24 characters or less' })
|
.max(24, { message: "Username must be 24 characters or less" })
|
||||||
.regex(/^[a-zA-Z0-9!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]*$/, { message: 'Username can only contain letters, numbers, and special characters.' }) // Updated regex pattern
|
.regex(/^[a-zA-Z0-9!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]*$/, {
|
||||||
});
|
message:
|
||||||
|
"Username can only contain letters, numbers, and special characters.",
|
||||||
|
}), // Updated regex pattern
|
||||||
|
});
|
||||||
|
|
||||||
export const updateEmailSchema = z.object({
|
export const updateEmailSchema = z.object({
|
||||||
email: z
|
email: z
|
||||||
.string({ required_error: 'Email is required' })
|
.string({ required_error: "Email is required" })
|
||||||
.email({ message: 'Email must be a valid email' })
|
.email({ message: "Email must be a valid email" }),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateUsernameSchema = z.object({
|
export const updateUsernameSchema = z.object({
|
||||||
username: z
|
username: z
|
||||||
.string({ required_error: 'Username is required' })
|
.string({ required_error: "Username is required" })
|
||||||
.min(2, { message: 'Username must be at least 2 characters' })
|
.min(2, { message: "Username must be at least 2 characters" })
|
||||||
.max(24, { message: 'Username must be 24 characters or less' })
|
.max(24, { message: "Username must be 24 characters or less" })
|
||||||
.regex(/^[a-zA-Z0-9]*$/, { message: 'Username can only contain letters or numbers.' })
|
.regex(/^[a-zA-Z0-9]*$/, {
|
||||||
|
message: "Username can only contain letters or numbers.",
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updatePasswordSchema = z
|
export const updatePasswordSchema = z
|
||||||
.object({
|
.object({
|
||||||
oldPassword: z.string({ required_error: 'Old password is required' }),
|
oldPassword: z.string({ required_error: "Old password is required" }),
|
||||||
password: z
|
password: z
|
||||||
.string({ required_error: 'Password is required' })
|
.string({ required_error: "Password is required" })
|
||||||
.regex(/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&+\-,.\[\]{};':"\\|/=\(\)\^_*]{8,}$/, {
|
.regex(
|
||||||
message:
|
/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&+\-,.\[\]{};':"\\|/=\(\)\^_*]{8,}$/,
|
||||||
'Password must be a minimum of 8 characters & contain at least one letter, one number, and one special character.'
|
{
|
||||||
}),
|
message:
|
||||||
passwordConfirm: z
|
"Password must be a minimum of 8 characters & contain at least one letter, one number, and one special character.",
|
||||||
.string({ required_error: 'Confirm Password is required' })
|
},
|
||||||
.regex(/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&+\-,.\[\]{};':"\\|/=\(\)\^_*]{8,}$/, {
|
),
|
||||||
message:
|
passwordConfirm: z
|
||||||
'Password must be a minimum of 8 characters & contain at least one letter, one number, and one special character.'
|
.string({ required_error: "Confirm Password is required" })
|
||||||
})
|
.regex(
|
||||||
})
|
/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&+\-,.\[\]{};':"\\|/=\(\)\^_*]{8,}$/,
|
||||||
.superRefine(({ passwordConfirm, password }, ctx) => {
|
{
|
||||||
if (passwordConfirm !== password) {
|
message:
|
||||||
ctx.addIssue({
|
"Password must be a minimum of 8 characters & contain at least one letter, one number, and one special character.",
|
||||||
code: z.ZodIssueCode.custom,
|
},
|
||||||
message: 'Password & Confirm password must match',
|
),
|
||||||
path: ['password']
|
})
|
||||||
});
|
.superRefine(({ passwordConfirm, password }, ctx) => {
|
||||||
ctx.addIssue({
|
if (passwordConfirm !== password) {
|
||||||
code: z.ZodIssueCode.custom,
|
ctx.addIssue({
|
||||||
message: 'Password & Confirm password must match',
|
code: z.ZodIssueCode.custom,
|
||||||
path: ['passwordConfirm']
|
message: "Password & Confirm password must match",
|
||||||
});
|
path: ["password"],
|
||||||
}
|
});
|
||||||
});
|
ctx.addIssue({
|
||||||
|
code: z.ZodIssueCode.custom,
|
||||||
|
message: "Password & Confirm password must match",
|
||||||
|
path: ["passwordConfirm"],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
export const updateProfileSchema = z.object({
|
export const updateProfileSchema = z.object({
|
||||||
name: z
|
name: z
|
||||||
.string({ required_error: 'Name is required' })
|
.string({ required_error: "Name is required" })
|
||||||
.min(1, { message: 'Name is required' })
|
.min(1, { message: "Name is required" })
|
||||||
.max(64, { message: 'Name must be 64 characters or less' })
|
.max(64, { message: "Name must be 64 characters or less" })
|
||||||
.trim(),
|
.trim(),
|
||||||
avatar: z
|
avatar: z
|
||||||
.instanceof(Blob)
|
.instanceof(Blob)
|
||||||
.optional()
|
.optional()
|
||||||
.superRefine((val, ctx) => {
|
|
||||||
if (val) {
|
|
||||||
if (val.size > 5242880) {
|
|
||||||
ctx.addIssue({
|
|
||||||
code: z.ZodIssueCode.custom,
|
|
||||||
message: 'Avatar must be less than 5MB'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!imageTypes.includes(val.type)) {
|
|
||||||
ctx.addIssue({
|
|
||||||
code: z.ZodIssueCode.custom,
|
|
||||||
message: 'Unsupported file type. Supported formats: jpeg, jpg, png, webp, svg, gif'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const updateAvatarSchema = z.object({
|
|
||||||
avatar: z
|
|
||||||
.instanceof(File)
|
|
||||||
.superRefine((val, ctx) => {
|
.superRefine((val, ctx) => {
|
||||||
if (val) {
|
if (val) {
|
||||||
if (val.size > 5242880) {
|
if (val.size > 5242880) {
|
||||||
ctx.addIssue({
|
ctx.addIssue({
|
||||||
code: z.ZodIssueCode.custom,
|
code: z.ZodIssueCode.custom,
|
||||||
message: 'Avatar must be less than 5MB',
|
message: "Avatar must be less than 5MB",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (!imageTypes.includes(val.type)) {
|
||||||
val.type &&
|
|
||||||
!imageTypes.includes(val.type) &&
|
|
||||||
!videoTypes.includes(val.type)
|
|
||||||
) {
|
|
||||||
ctx.addIssue({
|
ctx.addIssue({
|
||||||
code: z.ZodIssueCode.custom,
|
code: z.ZodIssueCode.custom,
|
||||||
message:
|
message:
|
||||||
'Unsupported file type. Supported formats: jpeg, jpg, png, webp, svg, gif',
|
"Unsupported file type. Supported formats: jpeg, jpg, png, webp, svg, gif",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const updateAvatarSchema = z.object({
|
||||||
|
avatar: z.instanceof(File).superRefine((val, ctx) => {
|
||||||
|
if (val) {
|
||||||
|
if (val.size > 5242880) {
|
||||||
|
ctx.addIssue({
|
||||||
|
code: z.ZodIssueCode.custom,
|
||||||
|
message: "Avatar must be less than 5MB",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
val.type &&
|
||||||
|
!imageTypes.includes(val.type) &&
|
||||||
|
!videoTypes.includes(val.type)
|
||||||
|
) {
|
||||||
|
ctx.addIssue({
|
||||||
|
code: z.ZodIssueCode.custom,
|
||||||
|
message:
|
||||||
|
"Unsupported file type. Supported formats: jpeg, jpg, png, webp, svg, gif",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
export const createCommentTextSchema = z.object({
|
export const createCommentTextSchema = z.object({
|
||||||
comment: z
|
comment: z
|
||||||
.string({ required_error: 'Comment cannot be empty' })
|
.string({ required_error: "Comment cannot be empty" })
|
||||||
.min(1, { message: 'Comment cannot be empty' })
|
.min(1, { message: "Comment cannot be empty" })
|
||||||
//.max(40000, { message: 'Comment is too long. Keep it simple and concise bruv!' })
|
//.max(40000, { message: 'Comment is too long. Keep it simple and concise bruv!' })
|
||||||
.trim(),
|
.trim(),
|
||||||
user: z.string({ required_error: 'User is required.' }),
|
user: z.string({ required_error: "User is required." }),
|
||||||
post: z.string({ required_error: 'Post is required.' }),
|
post: z.string({ required_error: "Post is required." }),
|
||||||
reply: z.string(),
|
reply: z.string(),
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const updateCommentTextSchema = z.object({
|
export const updateCommentTextSchema = z.object({
|
||||||
comment: z
|
comment: z
|
||||||
.string({ required_error: 'Comment cannot be empty' })
|
.string({ required_error: "Comment cannot be empty" })
|
||||||
.min(1, { message: 'Comment cannot be empty' })
|
.min(1, { message: "Comment cannot be empty" })
|
||||||
//.max(40000, { message: 'Comment is too long. Keep it simple and concise bruv!' })
|
//.max(40000, { message: 'Comment is too long. Keep it simple and concise bruv!' })
|
||||||
.trim(),
|
.trim(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
export const createCommentImageSchema = z.object({
|
export const createCommentImageSchema = z.object({
|
||||||
comment: z
|
comment: z
|
||||||
.string({ required_error: 'Comment cannot be empty' })
|
.string({ required_error: "Comment cannot be empty" })
|
||||||
.min(1, { message: 'Comment cannot be empty' })
|
.min(1, { message: "Comment cannot be empty" })
|
||||||
//.max(40000, { message: 'Comment is too long. Keep it simple and concise bruv!' })
|
//.max(40000, { message: 'Comment is too long. Keep it simple and concise bruv!' })
|
||||||
.trim(),
|
.trim(),
|
||||||
image: z
|
image: z
|
||||||
.instanceof(Blob, { message: 'Image is required' })
|
.instanceof(Blob, { message: "Image is required" })
|
||||||
.superRefine((val, ctx) => {
|
.superRefine((val, ctx) => {
|
||||||
if (val) {
|
if (val) {
|
||||||
if (val.size > 5242880) {
|
if (val.size > 5242880) {
|
||||||
ctx.addIssue({
|
ctx.addIssue({
|
||||||
code: z.ZodIssueCode.custom,
|
code: z.ZodIssueCode.custom,
|
||||||
message: 'Image must be less than 5MB'
|
message: "Image must be less than 5MB",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!imageTypes.includes(val.type)) {
|
|
||||||
ctx.addIssue({
|
|
||||||
code: z.ZodIssueCode.custom,
|
|
||||||
message: 'Unsupported file type. Supported formats: jpeg, jpg, png, webp, svg, gif'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
user: z.string({ required_error: 'User is required.' }),
|
|
||||||
post: z.string({ required_error: 'Post is required.' }),
|
|
||||||
reply: z.string(),
|
|
||||||
|
|
||||||
|
if (!imageTypes.includes(val.type)) {
|
||||||
|
ctx.addIssue({
|
||||||
|
code: z.ZodIssueCode.custom,
|
||||||
|
message:
|
||||||
|
"Unsupported file type. Supported formats: jpeg, jpg, png, webp, svg, gif",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
user: z.string({ required_error: "User is required." }),
|
||||||
|
post: z.string({ required_error: "Post is required." }),
|
||||||
|
reply: z.string(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
export const createNotebookSchema = z.object({
|
export const createNotebookSchema = z.object({
|
||||||
title: z
|
title: z
|
||||||
.string({ required_error: 'Title cannot be empty' })
|
.string({ required_error: "Title cannot be empty" })
|
||||||
.min(1, { message: 'Title cannot be empty' })
|
.min(1, { message: "Title cannot be empty" })
|
||||||
.max(100, { message: 'Title is too long. Keep it simple and concise bruv!' })
|
.max(100, {
|
||||||
.trim(),
|
message: "Title is too long. Keep it simple and concise bruv!",
|
||||||
user: z.string({ required_error: 'User is required.' }),
|
})
|
||||||
|
.trim(),
|
||||||
|
user: z.string({ required_error: "User is required." }),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const createStrategySchema = z.object({
|
export const createStrategySchema = z.object({
|
||||||
title: z
|
title: z
|
||||||
.string({ required_error: 'Title cannot be empty' })
|
.string({ required_error: "Title cannot be empty" })
|
||||||
.min(1, { message: 'Title cannot be empty' })
|
.min(1, { message: "Title cannot be empty" })
|
||||||
.max(100, { message: 'Title is too long. Keep it simple and concise bruv!' })
|
.max(100, {
|
||||||
.trim(),
|
message: "Title is too long. Keep it simple and concise bruv!",
|
||||||
rules: z
|
})
|
||||||
.string()
|
.trim(),
|
||||||
.trim(),
|
rules: z.string().trim(),
|
||||||
results: z
|
results: z.string().trim(),
|
||||||
.string()
|
liveResults: z.string().trim(),
|
||||||
.trim(),
|
user: z.string({ required_error: "User is required." }),
|
||||||
liveResults: z
|
|
||||||
.string()
|
|
||||||
.trim(),
|
|
||||||
user: z.string({ required_error: 'User is required.' }),
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
export const createPortfolioSchema = z.object({
|
export const createPortfolioSchema = z.object({
|
||||||
accountValue: z
|
accountValue: z.string().trim(),
|
||||||
.string()
|
availableCash: z.string().trim(),
|
||||||
.trim(),
|
overallReturn: z.string().trim(),
|
||||||
availableCash: z
|
rank: z.string().trim(),
|
||||||
.string()
|
holdings: z.string().trim(),
|
||||||
.trim(),
|
tradingHistory: z.string().trim(),
|
||||||
overallReturn: z
|
metrics: z.string().trim(),
|
||||||
.string()
|
user: z.string({ required_error: "User is required." }),
|
||||||
.trim(),
|
|
||||||
rank: z
|
|
||||||
.string()
|
|
||||||
.trim(),
|
|
||||||
holdings: z
|
|
||||||
.string()
|
|
||||||
.trim(),
|
|
||||||
tradingHistory: z
|
|
||||||
.string()
|
|
||||||
.trim(),
|
|
||||||
metrics: z
|
|
||||||
.string()
|
|
||||||
.trim(),
|
|
||||||
user: z.string({ required_error: 'User is required.' }),
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
export const createWatchListSchema = z.object({
|
export const createWatchListSchema = z.object({
|
||||||
title: z
|
title: z
|
||||||
.string({ required_error: 'Title cannot be empty' })
|
.string({ required_error: "Title cannot be empty" })
|
||||||
.min(1, { message: 'Title cannot be empty' })
|
.min(1, { message: "Title cannot be empty" })
|
||||||
.max(100, { message: 'Title is too long. Keep it simple and concise bruv!' })
|
.max(100, {
|
||||||
.trim(),
|
message: "Title is too long. Keep it simple and concise bruv!",
|
||||||
ticker: z
|
})
|
||||||
.string()
|
.trim(),
|
||||||
.trim(),
|
ticker: z.string().trim(),
|
||||||
user: z.string({ required_error: 'User is required.' }),
|
user: z.string({ required_error: "User is required." }),
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const editWatchListSchema = z.object({
|
export const editWatchListSchema = z.object({
|
||||||
title: z
|
title: z
|
||||||
.string({ required_error: 'Title cannot be empty' })
|
.string({ required_error: "Title cannot be empty" })
|
||||||
.min(1, { message: 'Title cannot be empty' })
|
.min(1, { message: "Title cannot be empty" })
|
||||||
.max(100, { message: 'Title is too long. Keep it simple and concise bruv!' })
|
.max(100, {
|
||||||
.trim(),
|
message: "Title is too long. Keep it simple and concise bruv!",
|
||||||
watchListId: z.string({ required_error: 'Id is required.' }),
|
})
|
||||||
|
.trim(),
|
||||||
|
watchListId: z.string({ required_error: "Id is required." }),
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,94 +1,94 @@
|
|||||||
function generateDateList(val) {
|
function generateDateList(val) {
|
||||||
var currentDate = new Date(); // Get the current date
|
var currentDate = new Date(); // Get the current date
|
||||||
|
|
||||||
var dateList = [];
|
var dateList = [];
|
||||||
dateList.push(formatDate(currentDate)); // Add current date to the list
|
dateList.push(formatDate(currentDate)); // Add current date to the list
|
||||||
|
|
||||||
for (var i = 1; i <= val; i++) { // Generate 10 more dates, 30 days apart
|
for (var i = 1; i <= val; i++) {
|
||||||
var previousDate = new Date(currentDate.getTime() - (i * 1 * 24 * 60 * 60 * 1000)); // Calculate the previous date
|
// Generate 10 more dates, 30 days apart
|
||||||
dateList.unshift(formatDate(previousDate)); // Add the previous date to the beginning of the list
|
var previousDate = new Date(
|
||||||
}
|
currentDate.getTime() - i * 1 * 24 * 60 * 60 * 1000,
|
||||||
|
); // Calculate the previous date
|
||||||
return dateList;
|
dateList.unshift(formatDate(previousDate)); // Add the previous date to the beginning of the list
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatDate(date) {
|
return dateList;
|
||||||
var year = date.getFullYear();
|
}
|
||||||
var month = ('0' + (date.getMonth() + 1)).slice(-2); // Month is zero-based, so we add 1
|
|
||||||
var day = ('0' + date.getDate()).slice(-2);
|
|
||||||
|
|
||||||
return year + '-' + month + '-' + day;
|
function formatDate(date) {
|
||||||
}
|
var year = date.getFullYear();
|
||||||
|
var month = ("0" + (date.getMonth() + 1)).slice(-2); // Month is zero-based, so we add 1
|
||||||
|
var day = ("0" + date.getDate()).slice(-2);
|
||||||
|
|
||||||
var dateList = generateDateList(30);
|
return year + "-" + month + "-" + day;
|
||||||
|
}
|
||||||
|
|
||||||
|
var dateList = generateDateList(30);
|
||||||
|
|
||||||
function generateRandomNumberList() {
|
function generateRandomNumberList() {
|
||||||
var numberList = [];
|
var numberList = [];
|
||||||
|
|
||||||
for (var i = 0; i < 30; i++) {
|
for (var i = 0; i < 30; i++) {
|
||||||
var randomNumber = Math.floor(Math.random() * (80 - 20 + 1)) + 20; // Generate random number between 20 and 80
|
var randomNumber = Math.floor(Math.random() * (80 - 20 + 1)) + 20; // Generate random number between 20 and 80
|
||||||
numberList.push(randomNumber); // Add the random number to the list
|
numberList.push(randomNumber); // Add the random number to the list
|
||||||
}
|
|
||||||
|
|
||||||
return numberList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateTrigonometricNumberList(val) {
|
return numberList;
|
||||||
var numberList = [];
|
}
|
||||||
|
|
||||||
for (var i = 0; i < 100; i++) {
|
function generateTrigonometricNumberList(val) {
|
||||||
var angle = (i / 100) * Math.PI * 2 ; // Calculate the angle based on the index
|
var numberList = [];
|
||||||
var value = Math.sin(angle) * val; // Calculate the sine value
|
|
||||||
numberList.push(value); // Add the value to the list
|
|
||||||
}
|
|
||||||
|
|
||||||
return numberList;
|
for (var i = 0; i < 100; i++) {
|
||||||
|
var angle = (i / 100) * Math.PI * 2; // Calculate the angle based on the index
|
||||||
|
var value = Math.sin(angle) * val; // Calculate the sine value
|
||||||
|
numberList.push(value); // Add the value to the list
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return numberList;
|
||||||
|
}
|
||||||
|
|
||||||
var rsiList = generateRandomNumberList();
|
var rsiList = generateRandomNumberList();
|
||||||
export const rsiGraph = {
|
export const rsiGraph = {
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: "category",
|
||||||
data: dateList
|
data: dateList,
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value'
|
type: "value",
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
data: rsiList,
|
data: rsiList,
|
||||||
type: 'line',
|
type: "line",
|
||||||
symbol: 'none', // Remove the dots
|
symbol: "none", // Remove the dots
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
type: 'solid', // Make the line solid
|
type: "solid", // Make the line solid
|
||||||
color: '#FFF' // Red color for the line
|
color: "#FFF", // Red color for the line
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
type: 'line',
|
{
|
||||||
symbol: 'none', // Remove the dots
|
type: "line",
|
||||||
data: Array(30).fill(30),
|
symbol: "none", // Remove the dots
|
||||||
lineStyle: {
|
data: Array(30).fill(30),
|
||||||
type: 'solid', // Make the line solid
|
lineStyle: {
|
||||||
color: '#0BA111', // Red color for the line
|
type: "solid", // Make the line solid
|
||||||
width: 4,
|
color: "#0BA111", // Red color for the line
|
||||||
}
|
width: 4,
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
type: 'line',
|
{
|
||||||
symbol: 'none', // Remove the dots
|
type: "line",
|
||||||
data: Array(30).fill(70),
|
symbol: "none", // Remove the dots
|
||||||
lineStyle: {
|
data: Array(30).fill(70),
|
||||||
type: 'solid', // Make the line solid
|
lineStyle: {
|
||||||
color: '#FF0000', // Red color for the line
|
type: "solid", // Make the line solid
|
||||||
width: 4,
|
color: "#FF0000", // Red color for the line
|
||||||
}
|
width: 4,
|
||||||
}
|
},
|
||||||
]
|
},
|
||||||
};
|
],
|
||||||
|
};
|
||||||
|
|
||||||
//MACD Indicator
|
//MACD Indicator
|
||||||
var macdList = generateTrigonometricNumberList(1);
|
var macdList = generateTrigonometricNumberList(1);
|
||||||
@ -96,70 +96,66 @@ var macdLineList = generateTrigonometricNumberList(1.5);
|
|||||||
|
|
||||||
var macdDateList = generateDateList(100);
|
var macdDateList = generateDateList(100);
|
||||||
export const macdGraph = {
|
export const macdGraph = {
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: "category",
|
||||||
data: macdDateList
|
data: macdDateList,
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value'
|
type: "value",
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
data: macdList,
|
data: macdList,
|
||||||
type: 'line',
|
type: "line",
|
||||||
symbol: 'none', // Remove the dots
|
symbol: "none", // Remove the dots
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
type: 'solid', // Make the line solid
|
type: "solid", // Make the line solid
|
||||||
color: '#0BA111' // Red color for the line
|
color: "#0BA111", // Red color for the line
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: macdLineList,
|
data: macdLineList,
|
||||||
type: 'line',
|
type: "line",
|
||||||
symbol: 'none', // Remove the dots
|
symbol: "none", // Remove the dots
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
type: 'solid', // Make the line solid
|
type: "solid", // Make the line solid
|
||||||
color: '#FF0000' // Red color for the line
|
color: "#FF0000", // Red color for the line
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//MACD Indicator
|
//MACD Indicator
|
||||||
var sma50List = generateTrigonometricNumberList(100);
|
var sma50List = generateTrigonometricNumberList(100);
|
||||||
var sma200List = generateTrigonometricNumberList(120);
|
var sma200List = generateTrigonometricNumberList(120);
|
||||||
|
|
||||||
|
|
||||||
var smaDateList = generateDateList(100);
|
var smaDateList = generateDateList(100);
|
||||||
export const smaGraph = {
|
export const smaGraph = {
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: "category",
|
||||||
data: smaDateList
|
data: smaDateList,
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value'
|
type: "value",
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
data: sma50List,
|
data: sma50List,
|
||||||
type: 'line',
|
type: "line",
|
||||||
symbol: 'none', // Remove the dots
|
symbol: "none", // Remove the dots
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
type: 'solid', // Make the line solid
|
type: "solid", // Make the line solid
|
||||||
color: '#0BA111' // Red color for the line
|
color: "#0BA111", // Red color for the line
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: sma200List,
|
data: sma200List,
|
||||||
type: 'line',
|
type: "line",
|
||||||
symbol: 'none', // Remove the dots
|
symbol: "none", // Remove the dots
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
type: 'solid', // Make the line solid
|
type: "solid", // Make the line solid
|
||||||
color: '#FF0000' // Red color for the line
|
color: "#FF0000", // Red color for the line
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@ -20,7 +20,7 @@ type FlyAndScaleParams = {
|
|||||||
|
|
||||||
export const flyAndScale = (
|
export const flyAndScale = (
|
||||||
node: Element,
|
node: Element,
|
||||||
params: FlyAndScaleParams = { y: -8, x: 0, start: 0.95, duration: 0 }
|
params: FlyAndScaleParams = { y: -8, x: 0, start: 0.95, duration: 0 },
|
||||||
): TransitionConfig => {
|
): TransitionConfig => {
|
||||||
const style = getComputedStyle(node);
|
const style = getComputedStyle(node);
|
||||||
const transform = style.transform === "none" ? "" : style.transform;
|
const transform = style.transform === "none" ? "" : style.transform;
|
||||||
@ -28,7 +28,7 @@ export const flyAndScale = (
|
|||||||
const scaleConversion = (
|
const scaleConversion = (
|
||||||
valueA: number,
|
valueA: number,
|
||||||
scaleA: [number, number],
|
scaleA: [number, number],
|
||||||
scaleB: [number, number]
|
scaleB: [number, number],
|
||||||
) => {
|
) => {
|
||||||
const [minA, maxA] = scaleA;
|
const [minA, maxA] = scaleA;
|
||||||
const [minB, maxB] = scaleB;
|
const [minB, maxB] = scaleB;
|
||||||
@ -40,7 +40,7 @@ export const flyAndScale = (
|
|||||||
};
|
};
|
||||||
|
|
||||||
const styleToString = (
|
const styleToString = (
|
||||||
style: Record<string, number | string | undefined>
|
style: Record<string, number | string | undefined>,
|
||||||
): string => {
|
): string => {
|
||||||
return Object.keys(style).reduce((str, key) => {
|
return Object.keys(style).reduce((str, key) => {
|
||||||
if (style[key] === undefined) return str;
|
if (style[key] === undefined) return str;
|
||||||
@ -212,7 +212,7 @@ export function sumQuarterlyResultsByYear(quarterlyResults, namingList) {
|
|||||||
|
|
||||||
// Filter out years with less than 4 quarters
|
// Filter out years with less than 4 quarters
|
||||||
const validYears = Object?.keys(quarterCounts)?.filter(
|
const validYears = Object?.keys(quarterCounts)?.filter(
|
||||||
(year) => quarterCounts[year] === 4
|
(year) => quarterCounts[year] === 4,
|
||||||
);
|
);
|
||||||
const annualResults = validYears?.map((year) => yearlySummaries[year]);
|
const annualResults = validYears?.map((year) => yearlySummaries[year]);
|
||||||
|
|
||||||
@ -420,7 +420,7 @@ export function formatETFName(inputString) {
|
|||||||
|
|
||||||
// Capitalize the first letter of each word
|
// Capitalize the first letter of each word
|
||||||
const capitalizedWords = words?.map(
|
const capitalizedWords = words?.map(
|
||||||
(word) => word.charAt(0)?.toUpperCase() + word?.slice(1)
|
(word) => word.charAt(0)?.toUpperCase() + word?.slice(1),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Join the words back together with a space between them
|
// Join the words back together with a space between them
|
||||||
@ -442,7 +442,7 @@ export function addDays(data, days, state) {
|
|||||||
} else {
|
} else {
|
||||||
const differenceInTime = result - createdDate;
|
const differenceInTime = result - createdDate;
|
||||||
const differenceInDays = Math.round(
|
const differenceInDays = Math.round(
|
||||||
differenceInTime / (1000 * 60 * 60 * 24)
|
differenceInTime / (1000 * 60 * 60 * 24),
|
||||||
);
|
);
|
||||||
return Math.abs(differenceInDays);
|
return Math.abs(differenceInDays);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,41 +1,43 @@
|
|||||||
// lib/workers/test.ts
|
// lib/workers/test.ts
|
||||||
|
|
||||||
async function loadNotifications(fastifyURL:string, userId:string) {
|
async function loadNotifications(fastifyURL: string, userId: string) {
|
||||||
|
const postData = { userId: userId };
|
||||||
|
|
||||||
const postData = {'userId': userId};
|
const response = await fetch(fastifyURL + "/get-notifications", {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
body: JSON.stringify(postData),
|
||||||
|
});
|
||||||
|
|
||||||
const response = await fetch(fastifyURL+'/get-notifications', {
|
const output = (await response.json())?.items;
|
||||||
method: 'POST',
|
return output;
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
},
|
|
||||||
body: JSON.stringify(postData)
|
|
||||||
});
|
|
||||||
|
|
||||||
const output = (await response.json())?.items;
|
|
||||||
return output
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onmessage = async (event: MessageEvent) => {
|
onmessage = async (event: MessageEvent) => {
|
||||||
const data = event.data?.message;
|
const data = event.data?.message;
|
||||||
const fastifyURL = data?.fastifyURL;
|
const fastifyURL = data?.fastifyURL;
|
||||||
const userId = data?.userId;
|
const userId = data?.userId;
|
||||||
try {
|
try {
|
||||||
|
const [notificationList] = await Promise.all([
|
||||||
|
loadNotifications(fastifyURL, userId),
|
||||||
|
]);
|
||||||
|
|
||||||
const [notificationList] = await Promise.all([
|
const numberOfUnreadNotification = notificationList?.length;
|
||||||
loadNotifications(fastifyURL, userId),
|
|
||||||
]);
|
|
||||||
|
|
||||||
const numberOfUnreadNotification = notificationList?.length
|
|
||||||
const hasUnreadElement = notificationList?.length !== 0 ? true : false;
|
const hasUnreadElement = notificationList?.length !== 0 ? true : false;
|
||||||
const output = {notificationList, hasUnreadElement, numberOfUnreadNotification}
|
const output = {
|
||||||
|
notificationList,
|
||||||
|
hasUnreadElement,
|
||||||
|
numberOfUnreadNotification,
|
||||||
|
};
|
||||||
|
|
||||||
postMessage({ message: 'success', output});
|
postMessage({ message: "success", output });
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
postMessage({ message: 'error', e});
|
postMessage({ message: "error", e });
|
||||||
}
|
}
|
||||||
// Sending data back to the main thread
|
// Sending data back to the main thread
|
||||||
//postMessage({ message: 'Data received in the worker', ticker, apiURL });
|
//postMessage({ message: 'Data received in the worker', ticker, apiURL });
|
||||||
};
|
};
|
||||||
|
|
||||||
export {};
|
export {};
|
||||||
|
|||||||
@ -1,32 +1,30 @@
|
|||||||
async function loadTwitchStatus(fastifyURL:string,) {
|
async function loadTwitchStatus(fastifyURL: string) {
|
||||||
// make the GET request to the endpoint
|
// make the GET request to the endpoint
|
||||||
const response = await fetch(fastifyURL+'/get-twitch-status', {
|
const response = await fetch(fastifyURL + "/get-twitch-status", {
|
||||||
method: 'GET',
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json","X-API-KEY": apiKey
|
"Content-Type": "application/json",
|
||||||
},
|
"X-API-KEY": apiKey,
|
||||||
});
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const output = (await response.json())?.items;
|
const output = (await response.json())?.items;
|
||||||
return output;
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
onmessage = async (event: MessageEvent) => {
|
||||||
|
const data = event.data?.message;
|
||||||
|
const fastifyURL = data?.fastifyURL;
|
||||||
|
try {
|
||||||
|
const twitchStatus = await loadTwitchStatus(fastifyURL);
|
||||||
|
const output = { twitchStatus };
|
||||||
|
|
||||||
|
postMessage({ message: "success", output });
|
||||||
|
} catch (e) {
|
||||||
|
postMessage({ message: "error", e });
|
||||||
}
|
}
|
||||||
|
// Sending data back to the main thread
|
||||||
|
//postMessage({ message: 'Data received in the worker', ticker, apiURL });
|
||||||
|
};
|
||||||
|
|
||||||
|
export {};
|
||||||
|
|
||||||
onmessage = async (event: MessageEvent) => {
|
|
||||||
const data = event.data?.message;
|
|
||||||
const fastifyURL = data?.fastifyURL;
|
|
||||||
try {
|
|
||||||
|
|
||||||
const twitchStatus = await loadTwitchStatus(fastifyURL);
|
|
||||||
const output = {twitchStatus};
|
|
||||||
|
|
||||||
postMessage({ message: 'success', output});
|
|
||||||
} catch(e) {
|
|
||||||
postMessage({ message: 'error', e});
|
|
||||||
}
|
|
||||||
// Sending data back to the main thread
|
|
||||||
//postMessage({ message: 'Data received in the worker', ticker, apiURL });
|
|
||||||
};
|
|
||||||
|
|
||||||
export {};
|
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
export const load = ({ locals, cookies }) => {
|
export const load = ({ locals, cookies }) => {
|
||||||
const { user, region, apiURL, fastifyURL, wsURL, apiKey } = locals;
|
const { user, region, apiURL, fastifyURL, wsURL, apiKey } = locals;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
user: user || undefined,
|
user: user || undefined,
|
||||||
region,
|
region,
|
||||||
cookieConsent: cookies?.get('cookie-consent'),
|
cookieConsent: cookies?.get("cookie-consent"),
|
||||||
apiURL,
|
apiURL,
|
||||||
fastifyURL,
|
fastifyURL,
|
||||||
wsURL,
|
wsURL,
|
||||||
apiKey,
|
apiKey,
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export const actions = {
|
|||||||
login: async ({ request, locals }) => {
|
login: async ({ request, locals }) => {
|
||||||
const { formData, errors } = await validateData(
|
const { formData, errors } = await validateData(
|
||||||
await request.formData(),
|
await request.formData(),
|
||||||
loginUserSchema
|
loginUserSchema,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (errors) {
|
if (errors) {
|
||||||
@ -52,7 +52,7 @@ export const actions = {
|
|||||||
register: async ({ locals, request }) => {
|
register: async ({ locals, request }) => {
|
||||||
const { formData, errors } = await validateData(
|
const { formData, errors } = await validateData(
|
||||||
await request.formData(),
|
await request.formData(),
|
||||||
registerUserSchema
|
registerUserSchema,
|
||||||
);
|
);
|
||||||
if (errors) {
|
if (errors) {
|
||||||
return fail(400, {
|
return fail(400, {
|
||||||
@ -122,7 +122,7 @@ export const actions = {
|
|||||||
const redirectURL = `${url.origin}/oauth`;
|
const redirectURL = `${url.origin}/oauth`;
|
||||||
|
|
||||||
const targetItem = authMethods.authProviders?.findIndex(
|
const targetItem = authMethods.authProviders?.findIndex(
|
||||||
(item) => item?.name === providerSelected
|
(item) => item?.name === providerSelected,
|
||||||
);
|
);
|
||||||
//console.log("==================")
|
//console.log("==================")
|
||||||
//console.log(authMethods.authProviders)
|
//console.log(authMethods.authProviders)
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export const load = async ({ parent }) => {
|
|||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
output = (await response.json())["stargazers_count"];
|
output = (await response.json())["stargazers_count"];
|
||||||
@ -43,7 +43,7 @@ export const load = async ({ parent }) => {
|
|||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
output = (await response.json())["stargazers_count"];
|
output = (await response.json())["stargazers_count"];
|
||||||
|
|||||||
@ -1,32 +1,31 @@
|
|||||||
import { getCache, setCache } from '$lib/store';
|
import { getCache, setCache } from "$lib/store";
|
||||||
|
|
||||||
|
export const load = async ({ parent, params }) => {
|
||||||
export const load = async ({parent, params}) => {
|
|
||||||
const getAnalystStats = async () => {
|
const getAnalystStats = async () => {
|
||||||
let output;
|
let output;
|
||||||
|
|
||||||
// Get cached data for the specific tickerID
|
// Get cached data for the specific tickerID
|
||||||
const cachedData = getCache(params.slug, 'getAnalystStats');
|
const cachedData = getCache(params.slug, "getAnalystStats");
|
||||||
if (cachedData) {
|
if (cachedData) {
|
||||||
output = cachedData;
|
output = cachedData;
|
||||||
} else {
|
} else {
|
||||||
|
const { apiURL, apiKey } = await parent();
|
||||||
|
|
||||||
const { apiURL, apiKey} = await parent();
|
const postData = { analystId: params.slug };
|
||||||
|
|
||||||
const postData = {'analystId': params.slug}
|
|
||||||
// make the POST request to the endpoint
|
// make the POST request to the endpoint
|
||||||
const response = await fetch(apiURL + '/analyst-stats', {
|
const response = await fetch(apiURL + "/analyst-stats", {
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
"Content-Type": "application/json",
|
||||||
|
"X-API-KEY": apiKey,
|
||||||
},
|
},
|
||||||
body: JSON.stringify(postData)
|
body: JSON.stringify(postData),
|
||||||
});
|
});
|
||||||
|
|
||||||
output = await response.json();
|
output = await response.json();
|
||||||
|
|
||||||
// Cache the data for this specific tickerID with a specific name 'getAnalystStats'
|
// Cache the data for this specific tickerID with a specific name 'getAnalystStats'
|
||||||
setCache(params.slug, output, 'getAnalystStats');
|
setCache(params.slug, output, "getAnalystStats");
|
||||||
}
|
}
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
@ -34,6 +33,6 @@ export const load = async ({parent, params}) => {
|
|||||||
|
|
||||||
// Make sure to return a promise
|
// Make sure to return a promise
|
||||||
return {
|
return {
|
||||||
getAnalystStats: await getAnalystStats()
|
getAnalystStats: await getAnalystStats(),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -1,69 +1,66 @@
|
|||||||
import type { RequestHandler } from './$types';
|
import type { RequestHandler } from "./$types";
|
||||||
|
|
||||||
function secondsUntilEndOfDay() {
|
function secondsUntilEndOfDay() {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const endOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1);
|
const endOfDay = new Date(
|
||||||
const secondsUntilEndOfDay = (endOfDay - now) / 1000;
|
now.getFullYear(),
|
||||||
return secondsUntilEndOfDay;
|
now.getMonth(),
|
||||||
|
now.getDate() + 1,
|
||||||
|
);
|
||||||
|
const secondsUntilEndOfDay = (endOfDay - now) / 1000;
|
||||||
|
return secondsUntilEndOfDay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const POST = (async ({ request, cookies, locals }) => {
|
||||||
|
let output = "error";
|
||||||
|
const data = await request.json();
|
||||||
|
const sentiment = data?.sentiment;
|
||||||
|
const ticker = data?.ticker;
|
||||||
|
const sentimentId = data?.sentimentId;
|
||||||
|
const maxAge = secondsUntilEndOfDay();
|
||||||
|
|
||||||
|
let newData;
|
||||||
|
|
||||||
export const POST = (async ( {request, cookies, locals} ) => {
|
if (cookies?.get("community-sentiment-" + ticker)) {
|
||||||
|
//console.log('already voted')
|
||||||
let output = 'error';
|
return new Response(JSON.stringify(output));
|
||||||
const data = await request.json()
|
} else {
|
||||||
const sentiment = data?.sentiment;
|
try {
|
||||||
const ticker = data?.ticker
|
if (sentimentId) {
|
||||||
const sentimentId = data?.sentimentId;
|
if (sentiment === "upvote") {
|
||||||
const maxAge = secondsUntilEndOfDay();
|
await locals?.pb
|
||||||
|
?.collection("sentiment")
|
||||||
let newData;
|
.update(sentimentId, { "upvote+": 1 });
|
||||||
|
} else if (sentiment === "downvote") {
|
||||||
if (cookies?.get('community-sentiment-'+ticker)) {
|
await locals?.pb
|
||||||
//console.log('already voted')
|
?.collection("sentiment")
|
||||||
return new Response(JSON.stringify(output))
|
.update(sentimentId, { "downvote+": 1 });
|
||||||
}
|
|
||||||
else {
|
|
||||||
try {
|
|
||||||
if (sentimentId) {
|
|
||||||
if (sentiment === 'upvote') {
|
|
||||||
await locals?.pb?.collection('sentiment').update( sentimentId, {'upvote+': 1})
|
|
||||||
}
|
|
||||||
else if (sentiment === 'downvote') {
|
|
||||||
await locals?.pb?.collection('sentiment').update( sentimentId, {'downvote+': 1})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
else {
|
|
||||||
|
|
||||||
if (sentiment === 'upvote') {
|
|
||||||
newData = await locals?.pb?.collection('sentiment').create({'ticker': ticker, 'upvote': 1})
|
|
||||||
}
|
|
||||||
else if (sentiment === 'downvote') {
|
|
||||||
newData = await locals?.pb?.collection('sentiment').create({'ticker': ticker, 'downvote': 1})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
output = 'success';
|
|
||||||
|
|
||||||
cookies.set('community-sentiment-'+ticker, sentiment, {httpOnly: true,
|
|
||||||
sameSite: 'lax',
|
|
||||||
secure: true,
|
|
||||||
path: '/',
|
|
||||||
maxAge: maxAge // End of day expiry
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
} catch(e) {
|
|
||||||
console.log(e);
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (sentiment === "upvote") {
|
||||||
|
newData = await locals?.pb
|
||||||
|
?.collection("sentiment")
|
||||||
|
.create({ ticker: ticker, upvote: 1 });
|
||||||
|
} else if (sentiment === "downvote") {
|
||||||
|
newData = await locals?.pb
|
||||||
|
?.collection("sentiment")
|
||||||
|
.create({ ticker: ticker, downvote: 1 });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
output = "success";
|
||||||
|
|
||||||
|
cookies.set("community-sentiment-" + ticker, sentiment, {
|
||||||
|
httpOnly: true,
|
||||||
|
sameSite: "lax",
|
||||||
|
secure: true,
|
||||||
|
path: "/",
|
||||||
|
maxAge: maxAge, // End of day expiry
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Response(JSON.stringify(output));
|
||||||
|
|
||||||
return new Response(JSON.stringify(output))
|
|
||||||
}) satisfies RequestHandler;
|
}) satisfies RequestHandler;
|
||||||
|
|
||||||
|
|||||||
@ -1,27 +1,22 @@
|
|||||||
import type { RequestHandler } from './$types';
|
import type { RequestHandler } from "./$types";
|
||||||
|
|
||||||
|
export const POST = (async ({ request, cookies }) => {
|
||||||
|
let output = "error";
|
||||||
|
const data = await request.json();
|
||||||
|
const consent = data?.consent;
|
||||||
|
try {
|
||||||
|
cookies.set("cookie-consent", consent, {
|
||||||
|
httpOnly: true,
|
||||||
|
sameSite: "lax",
|
||||||
|
secure: true,
|
||||||
|
path: "/",
|
||||||
|
maxAge: 60 * 60 * 24 * 365, // 1 Year consent
|
||||||
|
});
|
||||||
|
|
||||||
export const POST = (async ( {request, cookies} ) => {
|
output = "success";
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
|
||||||
let output = 'error';
|
return new Response(JSON.stringify(output));
|
||||||
const data = await request.json()
|
|
||||||
const consent = data?.consent;
|
|
||||||
try {
|
|
||||||
|
|
||||||
cookies.set('cookie-consent', consent, {httpOnly: true,
|
|
||||||
sameSite: 'lax',
|
|
||||||
secure: true,
|
|
||||||
path: '/',
|
|
||||||
maxAge: 60*60*24*365 // 1 Year consent
|
|
||||||
});
|
|
||||||
|
|
||||||
output = 'success';
|
|
||||||
|
|
||||||
} catch(e) {
|
|
||||||
console.log(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return new Response(JSON.stringify(output))
|
|
||||||
}) satisfies RequestHandler;
|
}) satisfies RequestHandler;
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,14 @@
|
|||||||
import type { RequestHandler } from './$types';
|
import type { RequestHandler } from "./$types";
|
||||||
import { serialize } from 'object-to-formdata';
|
import { serialize } from "object-to-formdata";
|
||||||
import { validateData } from '$lib/utils';
|
import { validateData } from "$lib/utils";
|
||||||
import { createCommentTextSchema, createCommentImageSchema } from '$lib/schemas';
|
import {
|
||||||
import { error} from '@sveltejs/kit';
|
createCommentTextSchema,
|
||||||
|
createCommentImageSchema,
|
||||||
|
} from "$lib/schemas";
|
||||||
|
import { error } from "@sveltejs/kit";
|
||||||
//import sharp from 'sharp';
|
//import sharp from 'sharp';
|
||||||
//import { marked } from 'marked';
|
//import { marked } from 'marked';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
export const config = {
|
export const config = {
|
||||||
runtime: 'nodejs20.x',
|
runtime: 'nodejs20.x',
|
||||||
@ -74,35 +76,34 @@ function addClassesToHtml(htmlString) {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const POST = (async ( {request, locals} ) => {
|
export const POST = (async ({ request, locals }) => {
|
||||||
|
let output = "error";
|
||||||
|
|
||||||
let output = 'error';
|
const body = await request.formData();
|
||||||
|
|
||||||
const body = await request.formData();
|
if (body?.get("comment") === "undefined") {
|
||||||
|
body?.delete("comment");
|
||||||
if (body?.get('comment') === 'undefined')
|
body?.append("comment", "");
|
||||||
{
|
|
||||||
body?.delete('comment');
|
|
||||||
body?.append('comment', '');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (body?.get('reply') === null)
|
if (body?.get("reply") === null) {
|
||||||
{
|
body?.delete("reply");
|
||||||
body?.delete('reply');
|
body?.append("reply", "");
|
||||||
body?.append('reply', '');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const {formData, errors} = await validateData( body, body?.get('image')?.length === 0 ? createCommentTextSchema : createCommentImageSchema);
|
const { formData, errors } = await validateData(
|
||||||
|
body,
|
||||||
|
body?.get("image")?.length === 0
|
||||||
|
? createCommentTextSchema
|
||||||
|
: createCommentImageSchema,
|
||||||
|
);
|
||||||
|
|
||||||
if (errors) {
|
if (errors) {
|
||||||
return new Response(JSON.stringify(output));
|
return new Response(JSON.stringify(output));
|
||||||
}
|
}
|
||||||
//formData.comment = addClassesToHtml(marked(formData?.comment))
|
//formData.comment = addClassesToHtml(marked(formData?.comment))
|
||||||
|
|
||||||
|
/*
|
||||||
/*
|
|
||||||
if (formData?.image?.type?.includes('image'))
|
if (formData?.image?.type?.includes('image'))
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -136,63 +137,53 @@ const body = await request.formData();
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//Each comment gives the user +1 Karma points
|
//Each comment gives the user +1 Karma points
|
||||||
|
|
||||||
await locals.pb.collection("users").update(locals?.user?.id, {
|
await locals.pb.collection("users").update(locals?.user?.id, {
|
||||||
"karma+": 1,
|
"karma+": 1,
|
||||||
})
|
});
|
||||||
|
|
||||||
|
|
||||||
let newComment;
|
let newComment;
|
||||||
try {
|
try {
|
||||||
|
newComment = await locals.pb
|
||||||
|
.collection("comments")
|
||||||
|
.create(serialize(formData), {
|
||||||
|
expand: "user,alreadyVoted(comment)",
|
||||||
|
fields:
|
||||||
|
"*,expand.user,expand.alreadyVoted(comment).user,expand.alreadyVoted(comment).type",
|
||||||
|
});
|
||||||
|
|
||||||
newComment = await locals.pb.collection('comments').create(serialize(formData), {
|
let postId = formData.post;
|
||||||
expand: 'user,alreadyVoted(comment)',
|
const opPost = await locals.pb.collection("posts").getOne(postId);
|
||||||
fields: "*,expand.user,expand.alreadyVoted(comment).user,expand.alreadyVoted(comment).type",
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let postId = formData.post
|
|
||||||
const opPost = await locals.pb.collection('posts').getOne(postId)
|
|
||||||
//create new record for notifications collections
|
//create new record for notifications collections
|
||||||
if (locals?.user?.id !== opPost?.user)
|
if (locals?.user?.id !== opPost?.user) {
|
||||||
{
|
let formDataNotifications = new FormData();
|
||||||
let formDataNotifications = new FormData();
|
formDataNotifications.append("opUser", opPost?.user);
|
||||||
formDataNotifications.append('opUser', opPost?.user);
|
formDataNotifications.append("user", formData?.user);
|
||||||
formDataNotifications.append('user', formData?.user)
|
formDataNotifications.append("post", postId);
|
||||||
formDataNotifications.append('post', postId);
|
formDataNotifications.append("comment", newComment?.id);
|
||||||
formDataNotifications.append('comment', newComment?.id)
|
formDataNotifications.append("notifyType", "comment");
|
||||||
formDataNotifications.append('notifyType', 'comment');
|
|
||||||
|
|
||||||
await locals.pb.collection('notifications').create(formDataNotifications);
|
|
||||||
|
|
||||||
|
await locals.pb.collection("notifications").create(formDataNotifications);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let formDataAlreadyVoted = new FormData();
|
let formDataAlreadyVoted = new FormData();
|
||||||
formDataAlreadyVoted.append('comment', newComment?.id);
|
formDataAlreadyVoted.append("comment", newComment?.id);
|
||||||
formDataAlreadyVoted.append('user', newComment?.user);
|
formDataAlreadyVoted.append("user", newComment?.user);
|
||||||
formDataAlreadyVoted.append('type', 'upvote');
|
formDataAlreadyVoted.append("type", "upvote");
|
||||||
//console.log(formDataAlreadyVoted)
|
//console.log(formDataAlreadyVoted)
|
||||||
await locals.pb.collection('alreadyVoted').create(formDataAlreadyVoted);
|
await locals.pb.collection("alreadyVoted").create(formDataAlreadyVoted);
|
||||||
|
|
||||||
//User always upvotes their comment in the intial state
|
|
||||||
await locals.pb.collection("comments").update(newComment?.id, {
|
|
||||||
"upvote+": 1,
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
output = 'success';
|
|
||||||
|
|
||||||
|
//User always upvotes their comment in the intial state
|
||||||
|
await locals.pb.collection("comments").update(newComment?.id, {
|
||||||
|
"upvote+": 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
output = "success";
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('Error: ', err);
|
console.log("Error: ", err);
|
||||||
error(err.status, err.message);
|
error(err.status, err.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return new Response(JSON.stringify([output, newComment]));
|
||||||
|
|
||||||
return new Response(JSON.stringify([output, newComment]));
|
|
||||||
}) satisfies RequestHandler;
|
}) satisfies RequestHandler;
|
||||||
@ -1,50 +1,47 @@
|
|||||||
import type { RequestHandler } from './$types';
|
import type { RequestHandler } from "./$types";
|
||||||
import { serialize } from 'object-to-formdata';
|
import { serialize } from "object-to-formdata";
|
||||||
import { validateData } from '$lib/utils';
|
import { validateData } from "$lib/utils";
|
||||||
import { updateCommentTextSchema} from '$lib/schemas';
|
import { updateCommentTextSchema } from "$lib/schemas";
|
||||||
import { error} from '@sveltejs/kit';
|
import { error } from "@sveltejs/kit";
|
||||||
|
|
||||||
|
export const POST = (async ({ request, locals }) => {
|
||||||
|
let output = "error";
|
||||||
|
|
||||||
export const POST = (async ( {request, locals} ) => {
|
const body = await request.formData();
|
||||||
|
const commentId = body?.get("commentId");
|
||||||
|
|
||||||
let output = 'error';
|
if (body?.get("comment") === "undefined") {
|
||||||
|
body?.delete("comment");
|
||||||
const body = await request.formData();
|
body?.append("comment", "");
|
||||||
const commentId = body?.get('commentId');
|
|
||||||
|
|
||||||
if (body?.get('comment') === 'undefined')
|
|
||||||
{
|
|
||||||
body?.delete('comment');
|
|
||||||
body?.append('comment', '');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const {formData, errors} = await validateData( body, updateCommentTextSchema);
|
const { formData, errors } = await validateData(
|
||||||
console.log(error)
|
body,
|
||||||
|
updateCommentTextSchema,
|
||||||
|
);
|
||||||
|
console.log(error);
|
||||||
|
|
||||||
if (errors) {
|
if (errors) {
|
||||||
|
|
||||||
return new Response(JSON.stringify(output));
|
return new Response(JSON.stringify(output));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let updateComment;
|
let updateComment;
|
||||||
try {
|
try {
|
||||||
|
updateComment = await locals.pb
|
||||||
|
.collection("comments")
|
||||||
|
.update(commentId, serialize(formData));
|
||||||
|
|
||||||
updateComment = await locals.pb.collection('comments').update(commentId,serialize(formData));
|
updateComment = await locals.pb.collection("comments").getOne(commentId, {
|
||||||
|
expand: "user,alreadyVoted(comment)",
|
||||||
updateComment = await locals.pb.collection('comments').getOne(commentId, {
|
fields:
|
||||||
expand: 'user,alreadyVoted(comment)',
|
"*,expand.user,expand.alreadyVoted(comment).user,expand.alreadyVoted(comment).type",
|
||||||
fields: "*,expand.user,expand.alreadyVoted(comment).user,expand.alreadyVoted(comment).type",
|
});
|
||||||
});
|
|
||||||
|
|
||||||
output = 'success';
|
|
||||||
|
|
||||||
|
output = "success";
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('Error: ', err);
|
console.log("Error: ", err);
|
||||||
error(err.status, err.message);
|
error(err.status, err.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return new Response(JSON.stringify([output, updateComment]));
|
||||||
|
|
||||||
return new Response(JSON.stringify([output, updateComment]));
|
|
||||||
}) satisfies RequestHandler;
|
}) satisfies RequestHandler;
|
||||||
@ -1,69 +1,82 @@
|
|||||||
import { promises as fsPromises } from 'fs';
|
import { promises as fsPromises } from "fs";
|
||||||
import fs from 'fs';
|
import fs from "fs";
|
||||||
import fetch from 'node-fetch';
|
import fetch from "node-fetch";
|
||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from "@sveltejs/kit";
|
||||||
|
|
||||||
const CHUNK_SIZE = 1 * 1024 * 1024; // 1MB in bytes
|
const CHUNK_SIZE = 1 * 1024 * 1024; // 1MB in bytes
|
||||||
|
|
||||||
const parseRange = (range: string) => {
|
const parseRange = (range: string) => {
|
||||||
const [start, end] = range.replace(/bytes=/, '').split('-').map(Number);
|
const [start, end] = range
|
||||||
return { start, end: end || undefined };
|
.replace(/bytes=/, "")
|
||||||
|
.split("-")
|
||||||
|
.map(Number);
|
||||||
|
return { start, end: end || undefined };
|
||||||
};
|
};
|
||||||
|
|
||||||
const createResponse = (body: ReadableStream | Buffer, headers: Record<string, string>, status = 206) =>
|
const createResponse = (
|
||||||
new Response(body, { status, headers });
|
body: ReadableStream | Buffer,
|
||||||
|
headers: Record<string, string>,
|
||||||
|
status = 206,
|
||||||
|
) => new Response(body, { status, headers });
|
||||||
|
|
||||||
const streamRemoteFile = async (url: string, range: string) => {
|
const streamRemoteFile = async (url: string, range: string) => {
|
||||||
const { start, end } = parseRange(range);
|
const { start, end } = parseRange(range);
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
headers: { Range: `bytes=${start}-${end || ''}` }
|
headers: { Range: `bytes=${start}-${end || ""}` },
|
||||||
});
|
});
|
||||||
|
|
||||||
return createResponse(response.body, {
|
return createResponse(response.body, {
|
||||||
'Content-Range': response.headers.get('Content-Range') || '',
|
"Content-Range": response.headers.get("Content-Range") || "",
|
||||||
'Accept-Ranges': 'bytes',
|
"Accept-Ranges": "bytes",
|
||||||
'Content-Length': response.headers.get('Content-Length') || '',
|
"Content-Length": response.headers.get("Content-Length") || "",
|
||||||
'Content-Type': response.headers.get('Content-Type') || '',
|
"Content-Type": response.headers.get("Content-Type") || "",
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const streamLocalFile = async (filePath: string, range: string) => {
|
const streamLocalFile = async (filePath: string, range: string) => {
|
||||||
const fileSize = (await fsPromises.stat(filePath)).size;
|
const fileSize = (await fsPromises.stat(filePath)).size;
|
||||||
const { start, end } = parseRange(range);
|
const { start, end } = parseRange(range);
|
||||||
const chunkEnd = end || Math.min(start + CHUNK_SIZE - 1, fileSize - 1);
|
const chunkEnd = end || Math.min(start + CHUNK_SIZE - 1, fileSize - 1);
|
||||||
|
|
||||||
if (start >= fileSize) {
|
if (start >= fileSize) {
|
||||||
return new Response(`Requested range not satisfiable\n${start} >= ${fileSize}`, {
|
return new Response(
|
||||||
status: 416,
|
`Requested range not satisfiable\n${start} >= ${fileSize}`,
|
||||||
headers: { 'Content-Range': `bytes */${fileSize}` },
|
{
|
||||||
});
|
status: 416,
|
||||||
}
|
headers: { "Content-Range": `bytes */${fileSize}` },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const stream = fs.createReadStream(filePath, { start, end: chunkEnd });
|
const stream = fs.createReadStream(filePath, { start, end: chunkEnd });
|
||||||
|
|
||||||
return createResponse(stream, {
|
return createResponse(stream, {
|
||||||
'Content-Range': `bytes ${start}-${chunkEnd}/${fileSize}`,
|
"Content-Range": `bytes ${start}-${chunkEnd}/${fileSize}`,
|
||||||
'Accept-Ranges': 'bytes',
|
"Accept-Ranges": "bytes",
|
||||||
'Content-Length': (chunkEnd - start + 1).toString(),
|
"Content-Length": (chunkEnd - start + 1).toString(),
|
||||||
'Content-Type': 'video/mp4',
|
"Content-Type": "video/mp4",
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const GET: RequestHandler = async ({ params, request }) => {
|
export const GET: RequestHandler = async ({ params, request }) => {
|
||||||
const { filename } = params;
|
const { filename } = params;
|
||||||
const range = request.headers.get('range');
|
const range = request.headers.get("range");
|
||||||
|
|
||||||
if (!range) {
|
if (!range) {
|
||||||
return new Response('Requires Range header', { status: 400 });
|
return new Response("Requires Range header", { status: 400 });
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const videoPath = filename.startsWith('http') ? filename : `static/${filename}`;
|
const videoPath = filename.startsWith("http")
|
||||||
return filename.startsWith('http') ?
|
? filename
|
||||||
await streamRemoteFile(videoPath, range) :
|
: `static/${filename}`;
|
||||||
await streamLocalFile(videoPath, range);
|
return filename.startsWith("http")
|
||||||
} catch (error) {
|
? await streamRemoteFile(videoPath, range)
|
||||||
console.error('Error streaming video:', error);
|
: await streamLocalFile(videoPath, range);
|
||||||
return new Response('File not found or error streaming video', { status: 404 });
|
} catch (error) {
|
||||||
}
|
console.error("Error streaming video:", error);
|
||||||
|
return new Response("File not found or error streaming video", {
|
||||||
|
status: 404,
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
@ -1,25 +1,23 @@
|
|||||||
import { pb } from "$lib/pocketbase";
|
import { pb } from "$lib/pocketbase";
|
||||||
import { getCache, setCache } from '$lib/store';
|
import { getCache, setCache } from "$lib/store";
|
||||||
|
|
||||||
|
export const load = async ({ parent }) => {
|
||||||
export const load = async ({parent}) => {
|
|
||||||
const getAllBlogPost = async () => {
|
const getAllBlogPost = async () => {
|
||||||
let output;
|
let output;
|
||||||
console.log(await parent())
|
console.log(await parent());
|
||||||
// Get cached data for the specific tickerID
|
// Get cached data for the specific tickerID
|
||||||
const cachedData = getCache('allBlogPost', 'getAllBlogPost');
|
const cachedData = getCache("allBlogPost", "getAllBlogPost");
|
||||||
if (cachedData) {
|
if (cachedData) {
|
||||||
output = cachedData;
|
output = cachedData;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// make the POST request to the endpoint
|
// make the POST request to the endpoint
|
||||||
output = await pb.collection('articles').getFullList({
|
output = await pb.collection("articles").getFullList({
|
||||||
expand: 'user',
|
expand: "user",
|
||||||
sort: '-created'
|
sort: "-created",
|
||||||
})
|
});
|
||||||
|
|
||||||
// Cache the data for this specific tickerID with a specific name 'getAllBlogPost'
|
// Cache the data for this specific tickerID with a specific name 'getAllBlogPost'
|
||||||
setCache('allBlogPost', output, 'getAllBlogPost');
|
setCache("allBlogPost", output, "getAllBlogPost");
|
||||||
}
|
}
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
@ -27,6 +25,6 @@ export const load = async ({parent}) => {
|
|||||||
|
|
||||||
// Make sure to return a promise
|
// Make sure to return a promise
|
||||||
return {
|
return {
|
||||||
getAllBlogPost: await getAllBlogPost()
|
getAllBlogPost: await getAllBlogPost(),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -1,22 +1,22 @@
|
|||||||
import { pb } from "$lib/pocketbase";
|
import { pb } from "$lib/pocketbase";
|
||||||
import { getCache, setCache } from '$lib/store';
|
import { getCache, setCache } from "$lib/store";
|
||||||
|
|
||||||
|
|
||||||
export const load = async ({ params }) => {
|
export const load = async ({ params }) => {
|
||||||
const getArticle = async () => {
|
const getArticle = async () => {
|
||||||
let output;
|
let output;
|
||||||
|
|
||||||
// Get cached data for the specific tickerID
|
// Get cached data for the specific tickerID
|
||||||
const cachedData = getCache(params?.slug, 'getArticle');
|
const cachedData = getCache(params?.slug, "getArticle");
|
||||||
if (cachedData) {
|
if (cachedData) {
|
||||||
output = cachedData;
|
output = cachedData;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// make the POST request to the endpoint
|
// make the POST request to the endpoint
|
||||||
output = await pb?.collection('articles')?.getOne(params?.slug, {expand: 'user'})
|
output = await pb
|
||||||
|
?.collection("articles")
|
||||||
|
?.getOne(params?.slug, { expand: "user" });
|
||||||
|
|
||||||
// Cache the data for this specific tickerID with a specific name 'getArticle'
|
// Cache the data for this specific tickerID with a specific name 'getArticle'
|
||||||
setCache(params?.slug, output, 'getArticle');
|
setCache(params?.slug, output, "getArticle");
|
||||||
}
|
}
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
@ -47,7 +47,6 @@ const getDiscordWidget = async () => {
|
|||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
// Make sure to return a promise
|
// Make sure to return a promise
|
||||||
return {
|
return {
|
||||||
getArticle: await getArticle(),
|
getArticle: await getArticle(),
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user