diff --git a/README.md b/README.md index 2de8320e..dc99d1a0 100644 --- a/README.md +++ b/README.md @@ -84,14 +84,21 @@ npm install flowbite flowbite-svelte tailwind-merge @popperjs/core ``` ## Tiptap Editor +Need to install ShadCN and Lucide for the Tiptap editor. ```bash npm install shadcn-svelte npm install lucide-svelte npm install mode-watcher -npx shadcn-svelte add dropdown-menu button tooltip input popover separator ``` -More packages related to the Tiptap editor +Now we initialize the ShadCN and ShadEditor packages. Follow the command line instructions. +```bash +npx shadcn-svelte@next init +npx shadcn-svelte@next add dropdown-menu button tooltip input popover separator +npx shadeditor init +``` + +More packages related to the Tiptap editor??? ```bash npm install @tiptap/extension-link @tiptap/extension-bullet-list @tiptap/extension-history @tiptap/extension-typography @tiptap/extension-underline ``` diff --git a/components.json b/components.json index f697c584..6df9e487 100644 --- a/components.json +++ b/components.json @@ -1,15 +1,17 @@ { - "style": "default", - "tailwind": { - "config": "tailwind.config.js", - "css": "src/app.css" - }, - "typescript": false, - "aliases": { - "utils": "$lib/utils", - "components": "$lib/components", - "hooks": "$lib/hooks", - "ui": "$lib/components/ui" - }, - "registry": "https://next.shadcn-svelte.com/registry" -} \ No newline at end of file + "$schema": "https://next.shadcn-svelte.com/schema.json", + "style": "default", + "tailwind": { + "config": "tailwind.config.ts", + "css": "src/app.postcss", + "baseColor": "gray" + }, + "aliases": { + "components": "$lib/components", + "utils": "$lib/utils", + "ui": "$lib/components/ui", + "hooks": "$lib/hooks" + }, + "typescript": true, + "registry": "https://next.shadcn-svelte.com/registry" +} diff --git a/package-lock.json b/package-lock.json index a41cab07..946e2c4d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,28 +10,16 @@ "dependencies": { "@floating-ui/dom": "^1.6.0", "@popperjs/core": "^2.11.0", - "@tiptap/core": "^2.10.2", "@tiptap/extension-bullet-list": "^2.10.2", - "@tiptap/extension-color": "^2.10.2", "@tiptap/extension-document": "^2.10.2", - "@tiptap/extension-highlight": "^2.10.2", "@tiptap/extension-history": "^2.10.2", - "@tiptap/extension-link": "^2.10.2", "@tiptap/extension-paragraph": "^2.10.2", - "@tiptap/extension-text": "^2.10.2", - "@tiptap/extension-typography": "^2.10.2", - "@tiptap/extension-underline": "^2.10.3", - "@tiptap/pm": "^2.10.2", - "@tiptap/starter-kit": "^2.10.2", "axios": "^1.7.0", "dayjs": "^1.11.10", "dexie": "^4.0.1-beta.14", "flowbite-svelte": "^0.47.00", "html5-qrcode": "^2.3.8", - "lucide-svelte": "^0.462.0", - "mode-watcher": "^0.5.0", - "shadcn-svelte": "^0.14.0", - "tailwind-merge": "^2.5.2" + "shadcn-svelte": "^0.14.0" }, "devDependencies": { "@playwright/test": "^1.28.1", @@ -44,25 +32,57 @@ "@sveltejs/vite-plugin-svelte": "^5.0.0", "@tailwindcss/forms": "^0.5.7", "@tailwindcss/typography": "^0.5.10", + "@tiptap/core": "^2.10.3", + "@tiptap/extension-bubble-menu": "^2.10.3", + "@tiptap/extension-code-block-lowlight": "^2.10.3", + "@tiptap/extension-color": "^2.10.3", + "@tiptap/extension-highlight": "^2.10.3", + "@tiptap/extension-image": "^2.10.3", + "@tiptap/extension-link": "^2.10.3", + "@tiptap/extension-subscript": "^2.10.3", + "@tiptap/extension-superscript": "^2.10.3", + "@tiptap/extension-table": "^2.10.3", + "@tiptap/extension-table-cell": "^2.10.3", + "@tiptap/extension-table-header": "^2.10.3", + "@tiptap/extension-table-row": "^2.10.3", + "@tiptap/extension-task-item": "^2.10.3", + "@tiptap/extension-task-list": "^2.10.3", + "@tiptap/extension-text": "^2.10.3", + "@tiptap/extension-text-align": "^2.10.3", + "@tiptap/extension-text-style": "^2.10.3", + "@tiptap/extension-typography": "^2.10.3", + "@tiptap/extension-underline": "^2.10.3", + "@tiptap/pm": "^2.10.3", + "@tiptap/starter-kit": "^2.10.3", "@types/eslint": "^9.0.0", "@types/node": "^22.0.0", "@typescript-eslint/eslint-plugin": "^8.0.0", "@typescript-eslint/parser": "^8.0.0", "autoprefixer": "^10.4.20", + "bits-ui": "^1.0.0-next.65", + "clsx": "^2.1.1", "eslint": "^9.0.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.24.0", "flowbite": "^2.5.1", "highlight.js": "^11.10.0", + "lowlight": "^3.2.0", + "lucide-svelte": "^0.462.0", + "mode-watcher": "^0.5.0", "postcss": "^8.4.41", "prettier": "^3.1.1", "prettier-plugin-svelte": "^3.1.2", "sass-embedded": "^1.81.0", "svelte": "^5.0.0", + "svelte-awesome-color-picker": "^3.1.4", "svelte-check": "^4.0.0", "svelte-highlight": "^7.7.0", "svelte-idle": "^3.0.1", + "svelte-tiptap": "^2.1.0", + "tailwind-merge": "^2.5.5", + "tailwind-variants": "^0.3.0", "tailwindcss": "^3.4.10", + "tailwindcss-animate": "^1.0.7", "tslib": "^2.4.1", "typescript": "^5.0.0", "typescript-svelte-plugin": "^0.3.43", @@ -772,6 +792,16 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@internationalized/date": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@internationalized/date/-/date-3.6.0.tgz", + "integrity": "sha512-+z6ti+CcJnRlLHok/emGEsWQhe7kfSmEW+/6qCzvKY67YPh7YOBfvc7+/+NXq+zJlbArg30tYpqLjNgcAYv2YQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@swc/helpers": "^0.5.0" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -1414,6 +1444,16 @@ "vite": "^6.0.0" } }, + "node_modules/@swc/helpers": { + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", + "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" + } + }, "node_modules/@tailwindcss/forms": { "version": "0.5.9", "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.9.tgz", @@ -1460,6 +1500,7 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-2.10.3.tgz", "integrity": "sha512-u9Mq4r8KzoeGVT8ms6FQDIMN95dTh3TYcT7fZpwcVM96mIl2Oyt+Bk66mL8z4zuFptfRI57Cu9QdnHEeILd//w==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1473,6 +1514,7 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-2.10.3.tgz", "integrity": "sha512-xnF1tS2BsORenr11qyybW120gHaeHKiKq+ZOP14cGA0MsriKvWDnaCSocXP/xMEYHy7+2uUhJ0MsKkHVj4bPzQ==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1482,6 +1524,24 @@ "@tiptap/core": "^2.7.0" } }, + "node_modules/@tiptap/extension-bubble-menu": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-2.10.3.tgz", + "integrity": "sha512-e9a4yMjQezuKy0rtyyzxbV2IAE1bm1PY3yoZEFrcaY0o47g1CMUn2Hwe+9As2HdntEjQpWR7NO1mZeKxHlBPYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tippy.js": "^6.3.7" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^2.7.0", + "@tiptap/pm": "^2.7.0" + } + }, "node_modules/@tiptap/extension-bullet-list": { "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-2.10.3.tgz", @@ -1499,6 +1559,7 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.10.3.tgz", "integrity": "sha512-JyLbfyY3cPctq9sVdpcRWTcoUOoq3/MnGE1eP6eBNyMTHyBPcM9TPhOkgj+xkD1zW/884jfelB+wa70RT/AMxQ==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1512,6 +1573,7 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.10.3.tgz", "integrity": "sha512-yiDVNg22fYkzsFk5kBlDSHcjwVJgajvO/M5fDXA+Hfxwo2oNcG6aJyyHXFe+UaXTVjdkPej0J6kcMKrTMCiFug==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1522,10 +1584,29 @@ "@tiptap/pm": "^2.7.0" } }, + "node_modules/@tiptap/extension-code-block-lowlight": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block-lowlight/-/extension-code-block-lowlight-2.10.3.tgz", + "integrity": "sha512-ieRSdfDW06pmKcsh73N506/EWNJrpMrZzyuFx3YGJtfM+Os0a9hMLy2TSuNleyRsihBi5mb+zvdeqeGdaJm7Ng==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^2.7.0", + "@tiptap/extension-code-block": "^2.7.0", + "@tiptap/pm": "^2.7.0", + "highlight.js": "^11", + "lowlight": "^2 || ^3" + } + }, "node_modules/@tiptap/extension-color": { "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-color/-/extension-color-2.10.3.tgz", "integrity": "sha512-FC2hPMSQ4w9UmO9kJCAdoU7gHpDbJ6MeJAmikB9EPp16dbGwFLrZm9TZ/4pv74fGfVm0lv720316ALOEgPEDjQ==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1553,6 +1634,7 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-dropcursor/-/extension-dropcursor-2.10.3.tgz", "integrity": "sha512-wzWf82ixWzZQr0hxcf/A0ul8NNxgy1N63O+c56st6OomoLuKUJWOXF+cs9O7V+/5rZKWdbdYYoRB5QLvnDBAlQ==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1563,10 +1645,30 @@ "@tiptap/pm": "^2.7.0" } }, + "node_modules/@tiptap/extension-floating-menu": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-2.10.3.tgz", + "integrity": "sha512-Prg8rYLxeyzHxfzVu1mDkkUWMnD9ZN3y370O/1qy55e+XKVw9jFkTSuz0y0+OhMJG6bulYpDUMtb+N3+2xOWlQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "tippy.js": "^6.3.7" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^2.7.0", + "@tiptap/pm": "^2.7.0" + } + }, "node_modules/@tiptap/extension-gapcursor": { "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-2.10.3.tgz", "integrity": "sha512-FskZi2DqDSTH1WkgLF2OLy0xU7qj3AgHsKhVsryeAtld4jAK5EsonneWgaipbz0e/MxuIvc1oyacfZKABpLaNg==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1581,6 +1683,7 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-2.10.3.tgz", "integrity": "sha512-2rFlimUKAgKDwT6nqAMtPBjkrknQY8S7oBNyIcDOUGyFkvbDUl3Jd0PiC929S5F3XStJRppnMqhpNDAlWmvBLA==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1594,6 +1697,7 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-2.10.3.tgz", "integrity": "sha512-AlxXXPCWIvw8hQUDFRskasj32iMNB8Sb19VgyFWqwvntGs2/UffNu8VdsVqxD2HpZ0g5rLYCYtSW4wigs9R3og==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1607,6 +1711,7 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-highlight/-/extension-highlight-2.10.3.tgz", "integrity": "sha512-srMOdpUTcp1yPGmUqgKOkbmTpCYOF6Q/8CnquDkhrvK7Gyphj+n8TocrKiloaRYZKcoQWtmb+kcVPaHhHMzsWQ==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1634,6 +1739,7 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-2.10.3.tgz", "integrity": "sha512-1a2IWhD00tgUNg/91RLnBvfENL7DLCui5L245+smcaLu+OXOOEpoBHawx59/M4hEpsjqvRRM79TzO9YXfopsPw==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1644,10 +1750,25 @@ "@tiptap/pm": "^2.7.0" } }, + "node_modules/@tiptap/extension-image": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-image/-/extension-image-2.10.3.tgz", + "integrity": "sha512-YIjAF5CwDkMe28OQ5pvnmdRgbJ9JcGMIHY1kyqNunSf2iwphK+6SWz9UEIkDFiT7AsRZySqxFSq93iK1XyTifw==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^2.7.0" + } + }, "node_modules/@tiptap/extension-italic": { "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-2.10.3.tgz", "integrity": "sha512-wAiO6ZxoHx2H90phnKttLWGPjPZXrfKxhOCsqYrK8BpRByhr48godOFRuGwYnKaiwoVjpxc63t+kDJDWvqmgMw==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1661,6 +1782,7 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-link/-/extension-link-2.10.3.tgz", "integrity": "sha512-8esKlkZBzEiNcpt7I8Cd6l1mWmCc/66pPbUq9LfnIniDXE3U+ahBf4m3TJltYFBGbiiTR/xqMtJyVHOpuLDtAw==", + "dev": true, "license": "MIT", "dependencies": { "linkifyjs": "^4.1.0" @@ -1678,6 +1800,7 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-2.10.3.tgz", "integrity": "sha512-9sok81gvZfSta2K1Dwrq5/HSz1jk4zHBpFqCx0oydzodGslx6X1bNxdca+eXJpXZmQIWALK7zEr4X8kg3WZsgw==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1691,6 +1814,7 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-2.10.3.tgz", "integrity": "sha512-/SFuEDnbJxy3jvi72LeyiPHWkV+uFc0LUHTUHSh20vwyy+tLrzncJfXohGbTIv5YxYhzExQYZDRD4VbSghKdlw==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1717,6 +1841,121 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-2.10.3.tgz", "integrity": "sha512-jYoPy6F6njYp3txF3u23bgdRy/S5ATcWDO9LPZLHSeikwQfJ47nqb+EUNo5M8jIOgFBTn4MEbhuZ6OGyhnxopA==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^2.7.0" + } + }, + "node_modules/@tiptap/extension-subscript": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-subscript/-/extension-subscript-2.10.3.tgz", + "integrity": "sha512-GkOwXIruM7QksmlfqLTKTC6JBpWSBDN2eeoPwggxXuqetqYs4sIx1ul3LEGDQy0vglcFKGkbbO2IiHCO/0fSWA==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^2.7.0" + } + }, + "node_modules/@tiptap/extension-superscript": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-superscript/-/extension-superscript-2.10.3.tgz", + "integrity": "sha512-4bXDPyT10ByVCLXFR8A70TcpFJ0H3PicRsxKJcQ+KZIauNUo5BBUpkF2cK+IOUp4UZ1W5ZBeuMQG5HWMuV9T1A==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^2.7.0" + } + }, + "node_modules/@tiptap/extension-table": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-table/-/extension-table-2.10.3.tgz", + "integrity": "sha512-XAvq0ptpHfuN7lQhTeew4Sqo8aKYHTqroa7cHL8I+gWJqYqKJSTGb4FAqdGIFEzHvnSsMCFbTL//kAHXvTdsHg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^2.7.0", + "@tiptap/pm": "^2.7.0" + } + }, + "node_modules/@tiptap/extension-table-cell": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-table-cell/-/extension-table-cell-2.10.3.tgz", + "integrity": "sha512-EYzBrnq7KUAcRhshIoTmC4ED8YoF4Ei5m8ZMPOctKX+QMAagKdcrw2UxuOf4tP2xgBYx+qDsKCautepZXQiL2g==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^2.7.0" + } + }, + "node_modules/@tiptap/extension-table-header": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-table-header/-/extension-table-header-2.10.3.tgz", + "integrity": "sha512-zJqzivz+VITYIFXNH09leBbkwAPuvp504rCAFL2PMa1uaME6+oiiRqZvXQrOiRkjNpOWEXH4dqvVLwkSMZoWaw==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^2.7.0" + } + }, + "node_modules/@tiptap/extension-table-row": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-table-row/-/extension-table-row-2.10.3.tgz", + "integrity": "sha512-l6P6BAE4SuIFdPmsRd+zGP2Ks9AhLAua7nfDlHFMWDnfOeaJu7g/t4oG++9xTojDcVDHhcIe8TJYUXfhOt2anw==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^2.7.0" + } + }, + "node_modules/@tiptap/extension-task-item": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-task-item/-/extension-task-item-2.10.3.tgz", + "integrity": "sha512-vE4qxGrZTdwynHq6l5xN0jI0ahDZpmKeoD6yuCMNyN831dgHXEjNrV8oBtZUvvqChFRc/LiSmUbrTInUn5xeNg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^2.7.0", + "@tiptap/pm": "^2.7.0" + } + }, + "node_modules/@tiptap/extension-task-list": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-task-list/-/extension-task-list-2.10.3.tgz", + "integrity": "sha512-Zj1pj+6VrL8VXlFYWdcLlCMykzARsvdqdU8cGVnBuC0H0vrSSfLGl+GxGnQwxTnqiNtxR4t70DLi/UjFBvzlqw==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1730,6 +1969,21 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-text/-/extension-text-2.10.3.tgz", "integrity": "sha512-7p9XiRprsRZm8y9jvF/sS929FCELJ5N9FQnbzikOiyGNUx5mdI+exVZlfvBr9xOD5s7fBLg6jj9Vs0fXPNRkPg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^2.7.0" + } + }, + "node_modules/@tiptap/extension-text-align": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-text-align/-/extension-text-align-2.10.3.tgz", + "integrity": "sha512-g75sNl73gtgjP3XIcl06kvv1qw3c0rGEUD848rUU1bvlBpU3IxjkcQLgYvHmv3vpuUp9cKUkA2wa7Sv6R3fjvw==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1743,6 +1997,7 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-text-style/-/extension-text-style-2.10.3.tgz", "integrity": "sha512-TalYIdlF7vBA4afFhmido7AORdBbu3sV+HCByda0FiNbM6cjng3Nr9oxHOCVJy+ChqrcgF4m54zDfLmamdyu5Q==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1756,6 +2011,7 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-typography/-/extension-typography-2.10.3.tgz", "integrity": "sha512-lLUm6PSufACffAFQaK3bwoM3nFlQ/RdG21a3rKOoLWh+abYvIZ8UilYgebH9r2+DBET6UrG7I/0mBtm+L/Lheg==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1769,6 +2025,7 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-2.10.3.tgz", "integrity": "sha512-VeGs0jeNiTnXddHHJEgOc/sKljZiyTEgSSuqMmsBACrr9aGFXbLTgKTvNjkZ9WzSnu7LwgJuBrwEhg8yYixUyQ==", + "dev": true, "license": "MIT", "funding": { "type": "github", @@ -1812,6 +2069,7 @@ "version": "2.10.3", "resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-2.10.3.tgz", "integrity": "sha512-oq8xdVIMqohSs91ofHSr7i5dCp2F56Lb9aYIAI25lZmwNwQJL2geGOYjMSfL0IC4cQHPylIuSKYCg7vRFdZmAA==", + "dev": true, "license": "MIT", "dependencies": { "@tiptap/core": "^2.10.3", @@ -1865,6 +2123,16 @@ "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "license": "MIT" }, + "node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -1910,6 +2178,13 @@ "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", "license": "MIT" }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "8.17.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.17.0.tgz", @@ -2455,6 +2730,38 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bits-ui": { + "version": "1.0.0-next.65", + "resolved": "https://registry.npmjs.org/bits-ui/-/bits-ui-1.0.0-next.65.tgz", + "integrity": "sha512-6pJ2dYP28kkYhvXKyUh22ocTyzciRrx752FJ8+oKUDQ07qnP4O/D8oAFo9pbZVU1MJ3wSMTXkpOVI/DrkJhChQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@floating-ui/core": "^1.6.4", + "@floating-ui/dom": "^1.6.7", + "@internationalized/date": "^3.5.6", + "esm-env": "^1.1.2", + "runed": "^0.15.2", + "svelte-toolbelt": "^0.4.4" + }, + "engines": { + "node": ">=18", + "pnpm": ">=8.7.0" + }, + "funding": { + "url": "https://github.com/sponsors/huntabyte" + }, + "peerDependencies": { + "svelte": "^5.0.0-next.1" + } + }, + "node_modules/bits-ui/node_modules/esm-env": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.1.tgz", + "integrity": "sha512-U9JedYYjCnadUlXk7e1Kr+aENQhtUaoaV9+gZm1T8LC/YBAPJx3NSPIAurFOC0U5vrdSevnUJS2/wUVxGwPhng==", + "dev": true, + "license": "MIT" + }, "node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -2629,6 +2936,16 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -2649,6 +2966,13 @@ "dev": true, "license": "MIT" }, + "node_modules/colord": { + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", + "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==", + "dev": true, + "license": "MIT" + }, "node_modules/colorjs.io": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/colorjs.io/-/colorjs.io-0.5.2.tgz", @@ -2814,6 +3138,16 @@ "node": ">=0.4.0" } }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/devalue": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.1.1.tgz", @@ -2821,6 +3155,20 @@ "dev": true, "license": "MIT" }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/dexie": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/dexie/-/dexie-4.0.10.tgz", @@ -3770,6 +4118,13 @@ "node": ">=0.8.19" } }, + "node_modules/inline-style-parser": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.4.tgz", + "integrity": "sha512-0aO8FkhNZlj/ZIbNi7Lxxr12obT7cL1moPfE4tg1LkX7LlLfC6DeX4l2ZEud1ukP9jNQyNnfzQVqwbwmAATY4Q==", + "dev": true, + "license": "MIT" + }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -4018,6 +4373,7 @@ "version": "4.1.4", "resolved": "https://registry.npmjs.org/linkifyjs/-/linkifyjs-4.1.4.tgz", "integrity": "sha512-0/NxkHNpiJ0k9VrYCkAn9OtU1eu8xEr1tCCpDtSsVRm/SF0xAak2Gzv3QimSfgUgqLBCDlfhMbu73XvaEHUTPQ==", + "dev": true, "license": "MIT" }, "node_modules/locate-character": { @@ -4080,6 +4436,22 @@ "tslib": "^2.0.3" } }, + "node_modules/lowlight": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lowlight/-/lowlight-3.2.0.tgz", + "integrity": "sha512-8Me8xHTCBYEXwcJIPcurnXTeERl3plwb4207v6KPye48kX/oaYDiwXy+OCm3M/pyAPUrkMhalKsbYPm24f/UDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "devlop": "^1.0.0", + "highlight.js": "~11.10.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", @@ -4091,6 +4463,7 @@ "version": "0.462.0", "resolved": "https://registry.npmjs.org/lucide-svelte/-/lucide-svelte-0.462.0.tgz", "integrity": "sha512-BTY44UyXEhlakuPMS4w7NayKhDYARzmhEv3E2YchTiNZ/aySS0F2ktPscTlXRgSZ9xwqoozhnhO1oKhm/nnmqg==", + "dev": true, "license": "ISC", "peerDependencies": { "svelte": "^3 || ^4 || ^5.0.0-next.42" @@ -4250,6 +4623,7 @@ "version": "0.5.0", "resolved": "https://registry.npmjs.org/mode-watcher/-/mode-watcher-0.5.0.tgz", "integrity": "sha512-5E6fh/aXhAVv+U+DbeM0hCmskQE9u7WSmvnCRijJB/MJu7HtB73sjiCaZ9n1M8QHmzLrBFo8XBAUcWXkDm8Z9A==", + "dev": true, "license": "MIT", "peerDependencies": { "svelte": "^4.0.0 || ^5.0.0-next.1" @@ -5326,6 +5700,22 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/runed": { + "version": "0.15.4", + "resolved": "https://registry.npmjs.org/runed/-/runed-0.15.4.tgz", + "integrity": "sha512-kmbpstUd7v2FdlBM+MT78IyuOVd38tq/e7MHvVb0fnVCsPSPMD/m2Xh+wUhzg9qCJgxRjBbIKu68DlH/x5VXJA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/huntabyte", + "https://github.com/sponsors/tglide" + ], + "dependencies": { + "esm-env": "^1.0.0" + }, + "peerDependencies": { + "svelte": "^5.0.0-next.1" + } + }, "node_modules/rxjs": { "version": "7.8.1", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", @@ -6007,6 +6397,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/style-to-object": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.8.tgz", + "integrity": "sha512-xT47I/Eo0rwJmaXC4oilDGDWLohVhR6o/xAQcPQN8q6QBuZVL8qMYL85kLmST5cPjAorwvqIA4qXTRQoYHaL6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "inline-style-parser": "0.2.4" + } + }, "node_modules/sucrase": { "version": "3.35.0", "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz", @@ -6089,6 +6489,30 @@ "node": ">=18" } }, + "node_modules/svelte-awesome-color-picker": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/svelte-awesome-color-picker/-/svelte-awesome-color-picker-3.1.4.tgz", + "integrity": "sha512-tiFakxvSpCwodOSFW6CflnLVSldSlDY77rDipHfW7hvB+4gTP3y6uO+Dm9O9e7P5N7K+CNyNjjdjbZOHYkMyNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "colord": "^2.9.3", + "svelte-awesome-slider": "^1.1.2" + }, + "peerDependencies": { + "svelte": "^3.55.1 || ^4.0.0 || ^5.0.0" + } + }, + "node_modules/svelte-awesome-slider": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/svelte-awesome-slider/-/svelte-awesome-slider-1.1.2.tgz", + "integrity": "sha512-HFIWwq6rtX6aXyc6ns2R0P6pDLYIr6nRjTPyAddAiTAgZqsohAoEfOEwKKqMmZ6Q+CH48zzcFdyo6lFkBJvyQw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "svelte": "^3.54.0 || ^4.0.0 || ^5.0.0" + } + }, "node_modules/svelte-check": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.1.0.tgz", @@ -6193,6 +6617,46 @@ "dev": true, "license": "MIT" }, + "node_modules/svelte-tiptap": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/svelte-tiptap/-/svelte-tiptap-2.1.0.tgz", + "integrity": "sha512-CtmBM4RzJ7dibuglG6g8YsiyEiaFWAu6qFuX73STuxKFJqoBuqXQWpJqQRttrUWVp/rrrDFjd08zyC1Zzrl/Qg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "peerDependencies": { + "@tiptap/core": "^2.0.3", + "@tiptap/extension-bubble-menu": "^2.0.3", + "@tiptap/extension-floating-menu": "^2.0.3", + "@tiptap/pm": "^2.0.3", + "svelte": "^5.0.0" + } + }, + "node_modules/svelte-toolbelt": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/svelte-toolbelt/-/svelte-toolbelt-0.4.6.tgz", + "integrity": "sha512-k8OUvXBUifHZcAlWeY/HLg/4J0v5m2iOfOhn8fDmjt4AP8ZluaDh9eBFus9lFiLX6O5l6vKqI1dKL5wy7090NQ==", + "dev": true, + "funding": [ + "https://github.com/sponsors/huntabyte" + ], + "dependencies": { + "clsx": "^2.1.1", + "style-to-object": "^1.0.8" + }, + "engines": { + "node": ">=18", + "pnpm": ">=8.7.0" + }, + "peerDependencies": { + "svelte": "^5.0.0-next.126" + } + }, "node_modules/svelte/node_modules/esm-env": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.1.tgz", @@ -6347,6 +6811,23 @@ "url": "https://github.com/sponsors/dcastil" } }, + "node_modules/tailwind-variants": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/tailwind-variants/-/tailwind-variants-0.3.0.tgz", + "integrity": "sha512-ho2k5kn+LB1fT5XdNS3Clb96zieWxbStE9wNLK7D0AV64kdZMaYzAKo0fWl6fXLPY99ffF9oBJnIj5escEl/8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "tailwind-merge": "^2.5.4" + }, + "engines": { + "node": ">=16.x", + "pnpm": ">=7.x" + }, + "peerDependencies": { + "tailwindcss": "*" + } + }, "node_modules/tailwindcss": { "version": "3.4.15", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.15.tgz", @@ -6385,6 +6866,16 @@ "node": ">=14.0.0" } }, + "node_modules/tailwindcss-animate": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/tailwindcss-animate/-/tailwindcss-animate-1.0.7.tgz", + "integrity": "sha512-bl6mpH3T7I3UFxuvDEXLxy/VuFxBk5bbzplh7tXI68mwMokNYd1t9qPBHlnyTwfa4JGC4zP516I1hYYtQ/vspA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "tailwindcss": ">=3.0.0 || insiders" + } + }, "node_modules/tailwindcss/node_modules/chokidar": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", @@ -6590,6 +7081,16 @@ "node": ">=14.0.0" } }, + "node_modules/tippy.js": { + "version": "6.3.7", + "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz", + "integrity": "sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@popperjs/core": "^2.9.0" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", diff --git a/package.json b/package.json index c98c2d19..6f17c5bc 100644 --- a/package.json +++ b/package.json @@ -27,25 +27,57 @@ "@sveltejs/vite-plugin-svelte": "^5.0.0", "@tailwindcss/forms": "^0.5.7", "@tailwindcss/typography": "^0.5.10", + "@tiptap/core": "^2.10.3", + "@tiptap/extension-bubble-menu": "^2.10.3", + "@tiptap/extension-code-block-lowlight": "^2.10.3", + "@tiptap/extension-color": "^2.10.3", + "@tiptap/extension-highlight": "^2.10.3", + "@tiptap/extension-image": "^2.10.3", + "@tiptap/extension-link": "^2.10.3", + "@tiptap/extension-subscript": "^2.10.3", + "@tiptap/extension-superscript": "^2.10.3", + "@tiptap/extension-table": "^2.10.3", + "@tiptap/extension-table-cell": "^2.10.3", + "@tiptap/extension-table-header": "^2.10.3", + "@tiptap/extension-table-row": "^2.10.3", + "@tiptap/extension-task-item": "^2.10.3", + "@tiptap/extension-task-list": "^2.10.3", + "@tiptap/extension-text": "^2.10.3", + "@tiptap/extension-text-align": "^2.10.3", + "@tiptap/extension-text-style": "^2.10.3", + "@tiptap/extension-typography": "^2.10.3", + "@tiptap/extension-underline": "^2.10.3", + "@tiptap/pm": "^2.10.3", + "@tiptap/starter-kit": "^2.10.3", "@types/eslint": "^9.0.0", "@types/node": "^22.0.0", "@typescript-eslint/eslint-plugin": "^8.0.0", "@typescript-eslint/parser": "^8.0.0", "autoprefixer": "^10.4.20", + "bits-ui": "^1.0.0-next.65", + "clsx": "^2.1.1", "eslint": "^9.0.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.24.0", "flowbite": "^2.5.1", "highlight.js": "^11.10.0", + "lowlight": "^3.2.0", + "lucide-svelte": "^0.462.0", + "mode-watcher": "^0.5.0", "postcss": "^8.4.41", "prettier": "^3.1.1", "prettier-plugin-svelte": "^3.1.2", "sass-embedded": "^1.81.0", "svelte": "^5.0.0", + "svelte-awesome-color-picker": "^3.1.4", "svelte-check": "^4.0.0", "svelte-highlight": "^7.7.0", "svelte-idle": "^3.0.1", + "svelte-tiptap": "^2.1.0", + "tailwind-merge": "^2.5.5", + "tailwind-variants": "^0.3.0", "tailwindcss": "^3.4.10", + "tailwindcss-animate": "^1.0.7", "tslib": "^2.4.1", "typescript": "^5.0.0", "typescript-svelte-plugin": "^0.3.43", @@ -57,27 +89,15 @@ "dependencies": { "@floating-ui/dom": "^1.6.0", "@popperjs/core": "^2.11.0", - "@tiptap/core": "^2.10.2", "@tiptap/extension-bullet-list": "^2.10.2", - "@tiptap/extension-color": "^2.10.2", "@tiptap/extension-document": "^2.10.2", - "@tiptap/extension-highlight": "^2.10.2", "@tiptap/extension-history": "^2.10.2", - "@tiptap/extension-link": "^2.10.2", "@tiptap/extension-paragraph": "^2.10.2", - "@tiptap/extension-text": "^2.10.2", - "@tiptap/extension-typography": "^2.10.2", - "@tiptap/extension-underline": "^2.10.3", - "@tiptap/pm": "^2.10.2", - "@tiptap/starter-kit": "^2.10.2", "axios": "^1.7.0", "dayjs": "^1.11.10", "dexie": "^4.0.1-beta.14", "flowbite-svelte": "^0.47.00", "html5-qrcode": "^2.3.8", - "lucide-svelte": "^0.462.0", - "mode-watcher": "^0.5.0", - "shadcn-svelte": "^0.14.0", - "tailwind-merge": "^2.5.2" + "shadcn-svelte": "^0.14.0" } } diff --git a/src/app.css b/src/app.css new file mode 100644 index 00000000..f6165547 --- /dev/null +++ b/src/app.css @@ -0,0 +1,461 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; +@tailwind variants; + +@layer base { + :root { + --background: 0 0% 100%; + --foreground: 224 71.4% 4.1%; + --muted: 220 14.3% 95.9%; + --muted-foreground: 220 8.9% 46.1%; + --popover: 0 0% 100%; + --popover-foreground: 224 71.4% 4.1%; + --card: 0 0% 100%; + --card-foreground: 224 71.4% 4.1%; + --border: 220 13% 91%; + --input: 220 13% 91%; + --primary: 220.9 39.3% 11%; + --primary-foreground: 210 20% 98%; + --secondary: 220 14.3% 95.9%; + --secondary-foreground: 220.9 39.3% 11%; + --accent: 220 14.3% 95.9%; + --accent-foreground: 220.9 39.3% 11%; + --destructive: 0 72.2% 50.6%; + --destructive-foreground: 210 20% 98%; + --ring: 224 71.4% 4.1%; + --radius: 0.5rem; + --sidebar-background: 0 0% 98%; + --sidebar-foreground: 240 5.3% 26.1%; + --sidebar-primary: 240 5.9% 10%; + --sidebar-primary-foreground: 0 0% 98%; + --sidebar-accent: 240 4.8% 95.9%; + --sidebar-accent-foreground: 240 5.9% 10%; + --sidebar-border: 220 13% 91%; + --sidebar-ring: 217.2 91.2% 59.8%; + } + + .dark { + --background: 224 71.4% 4.1%; + --foreground: 210 20% 98%; + --muted: 215 27.9% 16.9%; + --muted-foreground: 217.9 10.6% 64.9%; + --popover: 224 71.4% 4.1%; + --popover-foreground: 210 20% 98%; + --card: 224 71.4% 4.1%; + --card-foreground: 210 20% 98%; + --border: 215 27.9% 16.9%; + --input: 215 27.9% 16.9%; + --primary: 210 20% 98%; + --primary-foreground: 220.9 39.3% 11%; + --secondary: 215 27.9% 16.9%; + --secondary-foreground: 210 20% 98%; + --accent: 215 27.9% 16.9%; + --accent-foreground: 210 20% 98%; + --destructive: 0 62.8% 30.6%; + --destructive-foreground: 210 20% 98%; + --ring: 216 12.2% 83.9%; + --sidebar-background: 240 5.9% 10%; + --sidebar-foreground: 240 4.8% 95.9%; + --sidebar-primary: 224.3 76.3% 48%; + --sidebar-primary-foreground: 0 0% 100%; + --sidebar-accent: 240 3.7% 15.9%; + --sidebar-accent-foreground: 240 4.8% 95.9%; + --sidebar-border: 240 3.7% 15.9%; + --sidebar-ring: 217.2 91.2% 59.8%; + } +} + +@layer base { + * { + @apply border-border; + } + body { + @apply bg-background text-foreground; + } +} + + + + +/* There are no more Tailwind layers. */ + +html, +body { + @apply h-full overflow-hidden; + + /* font-family: 'Liberation Sans', sans-serif; */ + /* font-family: 'Noto Sans', sans-serif; */ +} + +html.super_access #appShell { + background-color: hsla(0, 100%, 50%, 0.5); +} + +html.manager_access #appShell { + background-color: hsla(0, 50%, 75%, 0.5); +} +html.administrator_access #appShell { + background-color: hsla(40, 50%, 85%, 0.5); +} +html.trusted_access #appShell { + background-color: hsla(20, 50%, 85%, 0.25); +} + +/* default theme */ +/* @font-face { + font-family: 'Liberation Sans', sans-serif; + font-family: 'Noto Sans', sans-serif; + src: url('/fonts/liberation/LiberationSans-Regular.ttf'); + src: url('/fonts/noto/NotoSans-Regular.ttf'); + font-display: swap; +} */ + +/* modern theme */ +@font-face { + font-family: 'Quicksand'; + src: url('/fonts/Quicksand.ttf'); + font-display: swap; +} + +/* :root [data-theme='modern'] { */ + /* --theme-rounded-base: 20px; + --theme-rounded-container: 4px; */ + + /* --theme-font-family-base: 'Liberation Sans', sans-serif; */ + /* --theme-font-family-heading: 'Liberation Sans', sans-serif; */ +/* } */ + +.card-footer { + border-top: 1px solid hsla(0, 0%, 0%, 0.5); + margin-top: 1em; + padding-top: 1em; + + opacity: .5; +} + + +/* Tailwind: This "fixes" Tailwind's default group button styles that do not seem to allow hidding buttons. */ +.btn-group a.hidden, .btn-group button.hidden { + display: none; +} + + +.ae_d_none { + display: none; +} + + +/* Allow content to scroll horizontal if too wide */ +.ae_h_scrollfix { + max-width: 100%; + overflow-x: auto; +} + +/* These helps with the Skeleton Tailwind modal utility. */ +.ae_modal_scrollfix { + /* Allow modal content to scroll if it's too long */ + overflow-y: auto; + max-height: 96vh; + /* max-height: 99%; */ + +} + +.ae_debug { + /* A darker pink outline */ + outline: thin dashed; + outline-color: hsla(0, 100%, 50%, 0.15); + /* A light pink background color */ + background-color: hsla(0, 100%, 50%, 0.15); +} +.ae_debug:hover { + /* A darker pink outline */ + outline-color: hsla(0, 100%, 50%, 0.50); + /* A light pink background color */ + background-color: hsla(0, 100%, 50%, 0.40); +} + + +/* Deal with being in an iframe */ +#appShell #shell-header.iframe { + display: none; +} + +#appShell #shell-footer.iframe { + display: none; +} + +/* Remove the background from the body in all cases */ +/* body[data-theme] { */ + /* background: none; */ + /* background-image: none; */ +/* } */ + +/* Remove the background from the body if using iframes */ +/* body[data-theme]:has(#page.iframe) { */ + /* background: none; */ + /* background-image: none; */ + /* background-image: url('https://static.oneskyit.com/c/CHOW/images/CHOW_2024_yellow_background.png'); */ + /* background-size: cover; */ +/* } */ + +main { + /* background: none; + background-color: hsla(0, 0%, 100%, 0.92); */ +} + +main>section { + background: none; + background-color: hsla(0, 0%, 100%, 0.92); + padding: .5em; +} + +/* @media (min-width: 640px) { + main>div, main>section { + padding: 0; + max-width: 100%; + } +} */ + +/* @media (min-width: 768px) { + main>div, main>section { + padding: 0; + max-width: 100%; + } +} */ + +.ae_sponsorships { + /* background: none; */ + /* background-color: hsla(0, 0%, 100%, 0.92); */ + /* background-image: url('https://static.oneskyit.com/c/CHOW/images/CHOW_2024_yellow_background.png'); */ + /* background-size: cover; */ +} + +pre.pre_wrap { + white-space: pre-wrap; + word-break: normal; + word-wrap: normal; + + border: none; + + max-width: 100%; + overflow-x: auto; +} + + +input.required { + /* border-right: solid medium var(--color-warning-500); */ + /* color: var(--color-warning-500); */ +} + +input:required { + /* background-color: var(--alert-color-lightest); */ + /* border: solid 2px red; */ + /* outline: dashed thin var(--alert-color-lighter); */ + + /* border-right: solid medium var(--alert-color-mid); */ + /* border-right: solid medium var(--warning-color-mid); */ + /* border-right: solid medium var(--error-color-mid); */ +} +/* input:required:hover { + background-color: var(--alert-color-lighter); + border-right: solid thick var(--alert-color-darker); +} */ + +/* input:required::before { + display: block; + + content: '*'; + color: var(--warning-color-darker); + + top: 5px; + left: 5px; +} */ + +.input_required::after { + content: '*'; + color: rgb(var(--color-error-500) / 0.9); + + position: relative; + /* top: 0em; */ + left: .25em; +} + +/* Make the group a flex row by default */ +/* div.btn-group { */ + /* display: flex; */ + /* gap: 0; */ + /* flex-direction: row; */ + /* justify-content: space-around; */ + /* align-items: center; */ + /* margin: 0; + padding: 0; */ + +/* } */ +/* Make all button elements except for the the first button element not rounded on the left. */ +/* Make all button elements except for the fhe last button element not rounded on the right. */ +/* These helps with the Skeleton (Tailwind?) button group element. */ +.btn-group button { + border-radius: 0; + border: none; +} + +/* .md:btn-group button, +.lg:btn-group button { + border-radius: 0; + border: none; +} */ + +/* div.btn-group button:first-child { + border-top-left-radius: .25rem; + border-bottom-left-radius: .25rem; +} +div.btn-group button:last-child { + border-top-right-radius: .25rem; + border-bottom-right-radius: .25rem; +} */ + +.ae_obj_prop .label { + +} + +.ae_obj_prop .value { + font-weight: bold; +} + + +.ae_md_hide { + /* outline: medium dashed green; */ + /* display: none; */ + +} + +@media (max-width: 767px) { + .ae_md_hide { + /* outline: medium dashed red; */ + display: none; + } +} +@media (min-width: 768px) { + .ae_lg_hide { + /* outline: medium dashed blue; */ + display: none; + } +} + + + + +/* Use the div.ae_quick_modal_container to block background clicks when using the section.ae_quick_popover. */ +div.ae_quick_modal_container { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 100; + background-color: hsla(0, 0%, 0%, .5); +} + +/* The section.ae_quick_popover should be above the rest of the content and centered on the page. */ +section.ae_quick_popover { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 100; + background-color: hsla(0, 0%, 100%, .95); + padding: 1rem; + border-radius: .5rem; + box-shadow: 0 0 1rem hsla(0, 0%, 0%, .5); + + min-height: 98%; + min-width: 98%; +} + +section.ae_quick_popover_small { + position: fixed; + top: 1em; + left: 50%; + transform: translate(-50%, 0%); + z-index: 100; + background-color: hsla(0, 0%, 100%, .95); + padding: 1rem; + border-radius: .5rem; + box-shadow: 0 0 1rem hsla(0, 0%, 0%, .5); + + min-height: 24rem; + max-height: 95%; + min-width: 50%; + max-width: 95%; +} + + +.fade_50 { + opacity: 0.5; +} +.fade_50:hover { + opacity: 1; +} + + +.auth_view_only { + display: none; +} +.ae_root--auth_access .auth_view_only { + display: initial; +} + + + +img.qr_code { + /* outline: solid thin hsla(30, 100%, 50%, .1); */ + /* width: 1.50in; */ +} + +img.qr_code:hover { + /* outline: solid thin green; */ + /* width: 2.50in; */ +} + +img.qr_code:focus { + /* outline: solid thin red; */ + /* width: 2.50in; */ +} + + +.dim { + opacity: 0.5; + color: hsla(0, 0%, 50%, .95); +} +.dim_warning { + opacity: 0.5; + /* color: hsla(0, 100%, 50%, .95); */ + /* background should be hash marks */ + background-image: repeating-linear-gradient(-45deg, hsla(0, 100%, 50%, .25), hsla(0, 100%, 50%, .25) 10px, transparent 10px, transparent 20px); +} + + +@media (max-width: 767px) { + .sk_header.hide_sm { + display: none; + } + .sk_header.show_sm { + display: initial; + } + .sk_header.show_md { + display: none; + } +} + +@media (min-width: 768px) { + .sk_header.hide_md { + display: none; + } + .sk_header.show_md { + display: initial; + } + .sk_header.show_sm { + display: none; + } +} diff --git a/src/app.postcss b/src/app.postcss index 1a026d3c..9631e131 100644 --- a/src/app.postcss +++ b/src/app.postcss @@ -2,384 +2,75 @@ @tailwind components; @tailwind utilities; @tailwind variants; -/* There are no more Tailwind layers. */ -html, -body { - @apply h-full overflow-hidden; +@layer base { + :root { + --background: 0 0% 100%; + --foreground: 224 71.4% 4.1%; + --muted: 220 14.3% 95.9%; + --muted-foreground: 220 8.9% 46.1%; + --popover: 0 0% 100%; + --popover-foreground: 224 71.4% 4.1%; + --card: 0 0% 100%; + --card-foreground: 224 71.4% 4.1%; + --border: 220 13% 91%; + --input: 220 13% 91%; + --primary: 220.9 39.3% 11%; + --primary-foreground: 210 20% 98%; + --secondary: 220 14.3% 95.9%; + --secondary-foreground: 220.9 39.3% 11%; + --accent: 220 14.3% 95.9%; + --accent-foreground: 220.9 39.3% 11%; + --destructive: 0 72.2% 50.6%; + --destructive-foreground: 210 20% 98%; + --ring: 224 71.4% 4.1%; + --radius: 0.5rem; + --sidebar-background: 0 0% 98%; + --sidebar-foreground: 240 5.3% 26.1%; + --sidebar-primary: 240 5.9% 10%; + --sidebar-primary-foreground: 0 0% 98%; + --sidebar-accent: 240 4.8% 95.9%; + --sidebar-accent-foreground: 240 5.9% 10%; + --sidebar-border: 220 13% 91%; + --sidebar-ring: 217.2 91.2% 59.8%; + } - /* font-family: 'Liberation Sans', sans-serif; */ - /* font-family: 'Noto Sans', sans-serif; */ + .dark { + --background: 224 71.4% 4.1%; + --foreground: 210 20% 98%; + --muted: 215 27.9% 16.9%; + --muted-foreground: 217.9 10.6% 64.9%; + --popover: 224 71.4% 4.1%; + --popover-foreground: 210 20% 98%; + --card: 224 71.4% 4.1%; + --card-foreground: 210 20% 98%; + --border: 215 27.9% 16.9%; + --input: 215 27.9% 16.9%; + --primary: 210 20% 98%; + --primary-foreground: 220.9 39.3% 11%; + --secondary: 215 27.9% 16.9%; + --secondary-foreground: 210 20% 98%; + --accent: 215 27.9% 16.9%; + --accent-foreground: 210 20% 98%; + --destructive: 0 62.8% 30.6%; + --destructive-foreground: 210 20% 98%; + --ring: 216 12.2% 83.9%; + --sidebar-background: 240 5.9% 10%; + --sidebar-foreground: 240 4.8% 95.9%; + --sidebar-primary: 224.3 76.3% 48%; + --sidebar-primary-foreground: 0 0% 100%; + --sidebar-accent: 240 3.7% 15.9%; + --sidebar-accent-foreground: 240 4.8% 95.9%; + --sidebar-border: 240 3.7% 15.9%; + --sidebar-ring: 217.2 91.2% 59.8%; + } } -html.super_access #appShell { - background-color: hsla(0, 100%, 50%, 0.5); -} - -html.manager_access #appShell { - background-color: hsla(0, 50%, 75%, 0.5); -} -html.administrator_access #appShell { - background-color: hsla(40, 50%, 85%, 0.5); -} -html.trusted_access #appShell { - background-color: hsla(20, 50%, 85%, 0.25); -} - -/* default theme */ -/* @font-face { - font-family: 'Liberation Sans', sans-serif; - font-family: 'Noto Sans', sans-serif; - src: url('/fonts/liberation/LiberationSans-Regular.ttf'); - src: url('/fonts/noto/NotoSans-Regular.ttf'); - font-display: swap; -} */ - -/* modern theme */ -@font-face { - font-family: 'Quicksand'; - src: url('/fonts/Quicksand.ttf'); - font-display: swap; -} - -/* :root [data-theme='modern'] { */ - /* --theme-rounded-base: 20px; - --theme-rounded-container: 4px; */ - - /* --theme-font-family-base: 'Liberation Sans', sans-serif; */ - /* --theme-font-family-heading: 'Liberation Sans', sans-serif; */ -/* } */ - -.card-footer { - border-top: 1px solid hsla(0, 0%, 0%, 0.5); - margin-top: 1em; - padding-top: 1em; - - opacity: .5; -} - - -/* Tailwind: This "fixes" Tailwind's default group button styles that do not seem to allow hidding buttons. */ -.btn-group a.hidden, .btn-group button.hidden { - display: none; -} - - -.ae_d_none { - display: none; -} - - -/* Allow content to scroll horizontal if too wide */ -.ae_h_scrollfix { - max-width: 100%; - overflow-x: auto; -} - -/* These helps with the Skeleton Tailwind modal utility. */ -.ae_modal_scrollfix { - /* Allow modal content to scroll if it's too long */ - overflow-y: auto; - max-height: 96vh; - /* max-height: 99%; */ - -} - -.ae_debug { - /* A darker pink outline */ - outline: thin dashed; - outline-color: hsla(0, 100%, 50%, 0.15); - /* A light pink background color */ - background-color: hsla(0, 100%, 50%, 0.15); -} -.ae_debug:hover { - /* A darker pink outline */ - outline-color: hsla(0, 100%, 50%, 0.50); - /* A light pink background color */ - background-color: hsla(0, 100%, 50%, 0.40); -} - - -/* Deal with being in an iframe */ -#appShell #shell-header.iframe { - display: none; -} - -#appShell #shell-footer.iframe { - display: none; -} - -/* Remove the background from the body in all cases */ -/* body[data-theme] { */ - /* background: none; */ - /* background-image: none; */ -/* } */ - -/* Remove the background from the body if using iframes */ -/* body[data-theme]:has(#page.iframe) { */ - /* background: none; */ - /* background-image: none; */ - /* background-image: url('https://static.oneskyit.com/c/CHOW/images/CHOW_2024_yellow_background.png'); */ - /* background-size: cover; */ -/* } */ - -main { - /* background: none; - background-color: hsla(0, 0%, 100%, 0.92); */ -} - -main>section { - background: none; - background-color: hsla(0, 0%, 100%, 0.92); - padding: .5em; -} - -/* @media (min-width: 640px) { - main>div, main>section { - padding: 0; - max-width: 100%; - } -} */ - -/* @media (min-width: 768px) { - main>div, main>section { - padding: 0; - max-width: 100%; - } -} */ - -.ae_sponsorships { - /* background: none; */ - /* background-color: hsla(0, 0%, 100%, 0.92); */ - /* background-image: url('https://static.oneskyit.com/c/CHOW/images/CHOW_2024_yellow_background.png'); */ - /* background-size: cover; */ -} - -pre.pre_wrap { - white-space: pre-wrap; - word-break: normal; - word-wrap: normal; - - border: none; - - max-width: 100%; - overflow-x: auto; -} - - -input.required { - /* border-right: solid medium var(--color-warning-500); */ - /* color: var(--color-warning-500); */ -} - -input:required { - /* background-color: var(--alert-color-lightest); */ - /* border: solid 2px red; */ - /* outline: dashed thin var(--alert-color-lighter); */ - - /* border-right: solid medium var(--alert-color-mid); */ - /* border-right: solid medium var(--warning-color-mid); */ - /* border-right: solid medium var(--error-color-mid); */ -} -/* input:required:hover { - background-color: var(--alert-color-lighter); - border-right: solid thick var(--alert-color-darker); -} */ - -/* input:required::before { - display: block; - - content: '*'; - color: var(--warning-color-darker); - - top: 5px; - left: 5px; -} */ - -.input_required::after { - content: '*'; - color: rgb(var(--color-error-500) / 0.9); - - position: relative; - /* top: 0em; */ - left: .25em; -} - -/* Make the group a flex row by default */ -/* div.btn-group { */ - /* display: flex; */ - /* gap: 0; */ - /* flex-direction: row; */ - /* justify-content: space-around; */ - /* align-items: center; */ - /* margin: 0; - padding: 0; */ - -/* } */ -/* Make all button elements except for the the first button element not rounded on the left. */ -/* Make all button elements except for the fhe last button element not rounded on the right. */ -/* These helps with the Skeleton (Tailwind?) button group element. */ -.btn-group button { - border-radius: 0; - border: none; -} - -/* .md:btn-group button, -.lg:btn-group button { - border-radius: 0; - border: none; -} */ - -/* div.btn-group button:first-child { - border-top-left-radius: .25rem; - border-bottom-left-radius: .25rem; -} -div.btn-group button:last-child { - border-top-right-radius: .25rem; - border-bottom-right-radius: .25rem; -} */ - -.ae_obj_prop .label { - -} - -.ae_obj_prop .value { - font-weight: bold; -} - - -.ae_md_hide { - /* outline: medium dashed green; */ - /* display: none; */ - -} - -@media (max-width: 767px) { - .ae_md_hide { - /* outline: medium dashed red; */ - display: none; - } -} -@media (min-width: 768px) { - .ae_lg_hide { - /* outline: medium dashed blue; */ - display: none; - } -} - - - - -/* Use the div.ae_quick_modal_container to block background clicks when using the section.ae_quick_popover. */ -div.ae_quick_modal_container { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 100; - background-color: hsla(0, 0%, 0%, .5); -} - -/* The section.ae_quick_popover should be above the rest of the content and centered on the page. */ -section.ae_quick_popover { - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - z-index: 100; - background-color: hsla(0, 0%, 100%, .95); - padding: 1rem; - border-radius: .5rem; - box-shadow: 0 0 1rem hsla(0, 0%, 0%, .5); - - min-height: 98%; - min-width: 98%; -} - -section.ae_quick_popover_small { - position: fixed; - top: 1em; - left: 50%; - transform: translate(-50%, 0%); - z-index: 100; - background-color: hsla(0, 0%, 100%, .95); - padding: 1rem; - border-radius: .5rem; - box-shadow: 0 0 1rem hsla(0, 0%, 0%, .5); - - min-height: 24rem; - max-height: 95%; - min-width: 50%; - max-width: 95%; -} - - -.fade_50 { - opacity: 0.5; -} -.fade_50:hover { - opacity: 1; -} - - -.auth_view_only { - display: none; -} -.ae_root--auth_access .auth_view_only { - display: initial; -} - - - -img.qr_code { - /* outline: solid thin hsla(30, 100%, 50%, .1); */ - /* width: 1.50in; */ -} - -img.qr_code:hover { - /* outline: solid thin green; */ - /* width: 2.50in; */ -} - -img.qr_code:focus { - /* outline: solid thin red; */ - /* width: 2.50in; */ -} - - -.dim { - opacity: 0.5; - color: hsla(0, 0%, 50%, .95); -} -.dim_warning { - opacity: 0.5; - /* color: hsla(0, 100%, 50%, .95); */ - /* background should be hash marks */ - background-image: repeating-linear-gradient(-45deg, hsla(0, 100%, 50%, .25), hsla(0, 100%, 50%, .25) 10px, transparent 10px, transparent 20px); -} - - -@media (max-width: 767px) { - .sk_header.hide_sm { - display: none; - } - .sk_header.show_sm { - display: initial; - } - .sk_header.show_md { - display: none; - } -} - -@media (min-width: 768px) { - .sk_header.hide_md { - display: none; - } - .sk_header.show_md { - display: initial; - } - .sk_header.show_sm { - display: none; - } -} +@layer base { + * { + @apply border-border; + } + body { + @apply bg-background text-foreground; + } +} \ No newline at end of file diff --git a/src/lib/ae_core/ae_core_functions.ts b/src/lib/ae_core/ae_core_functions.ts index d86eaba7..9f608bcf 100644 --- a/src/lib/ae_core/ae_core_functions.ts +++ b/src/lib/ae_core/ae_core_functions.ts @@ -61,7 +61,9 @@ async function handle_load_ae_obj_id__site_domain( log_lvl?: number } ) { - console.log(`*** handle_load_ae_obj_id__site_domain() *** fqdn=${fqdn}`); + if (log_lvl) { + console.log(`*** handle_load_ae_obj_id__site_domain() *** api.base_url=${api_cfg.base_url}, fqdn=${fqdn}, timeout=${timeout}`); + } let no_account_id = false; if (!api_cfg.account_id) { diff --git a/src/lib/components/.directory b/src/lib/components/.directory new file mode 100644 index 00000000..3f68a689 --- /dev/null +++ b/src/lib/components/.directory @@ -0,0 +1,7 @@ +[Dolphin] +Timestamp=2024,12,2,17,34,30.327 +Version=4 +ViewMode=1 + +[Settings] +HiddenFilesShown=true diff --git a/src/lib/components/shad-editor/editor-toolbar.svelte b/src/lib/components/shad-editor/editor-toolbar.svelte index 8d69f8f0..bc294e0b 100644 --- a/src/lib/components/shad-editor/editor-toolbar.svelte +++ b/src/lib/components/shad-editor/editor-toolbar.svelte @@ -11,7 +11,7 @@ import Code from './icons/code.svelte'; import BlockQuote from './icons/block-quote.svelte'; import Subscript from './icons/subscript.svelte'; - import ButtleList from './icons/buttle-list.svelte'; + import BulletList from './icons/buttle-list.svelte'; // Typo in the icon name import OrderedList from './icons/ordered-list.svelte'; import TaskList from './icons/task-list.svelte'; import Highlighter from './icons/highlighter.svelte'; @@ -24,35 +24,114 @@ import Text from './icons/text.svelte'; import SearchReplace from './icons/search-replace.svelte'; - interface Props { - editor: Editor; - } +interface Props { + editor: Editor; + show_button_kv: any; +} - let { editor }: Props = $props(); +let { editor, show_button_kv }: Props = $props(); + + + +let show_button_kv_defaults: any = { + undo: true, + redo: false, + + text: true, + + bold: true, + italic: true, + underline: true, + strikethrough: true, + align: true, + link: true, + code: false, + blockquote: false, + subscript: false, + superscript: false, + bullet_list: true, + ordered_list: true, + task_list: false, + image: false, + table: false, + text_color: true, + highlighter: true, + quick_color: true, + search_replace: true, +}; +if (show_button_kv) { + show_button_kv = {...show_button_kv_defaults, ...show_button_kv}; +} else { + show_button_kv = show_button_kv_defaults; +}
- - - - - - - - - - - -
- - - - - - - - - - - + {#if show_button_kv.undo} + + {/if} + {#if show_button_kv.redo} + + {/if} + + {#if show_button_kv.text} + + {/if} + {#if show_button_kv.bold} + + {/if} + {#if show_button_kv.italic} + + {/if} + {#if show_button_kv.underline} + + {/if} + {#if show_button_kv.strikethrough} + + {/if} + {#if show_button_kv.align} + + {/if} + {#if show_button_kv.link} + + {/if} + {#if show_button_kv.code} + + {/if} + {#if show_button_kv.blockquote} +
+ {/if} + {#if show_button_kv.subscript} + + {/if} + {#if show_button_kv.superscript} + + {/if} + {#if show_button_kv.bullet_list} + + {/if} + {#if show_button_kv.ordered_list} + + {/if} + {#if show_button_kv.task_list} + + {/if} + {#if show_button_kv.image} + + {/if} + {#if show_button_kv.table} +
+ {/if} + {#if show_button_kv.text_color} + + {/if} + {#if show_button_kv.highlighter} + + {/if} + {#if show_button_kv.quick_color} + + {/if} + {#if show_button_kv.search_replace} + + {/if} diff --git a/src/lib/components/shad-editor/shad-editor.svelte b/src/lib/components/shad-editor/shad-editor.svelte index ba8bab3b..ba8ee0ee 100644 --- a/src/lib/components/shad-editor/shad-editor.svelte +++ b/src/lib/components/shad-editor/shad-editor.svelte @@ -42,9 +42,17 @@ class?: string; content?: Content; showToolbar?: boolean; + // html_text?: string; + new_html?: string; } - let { class: className = '', content = $bindable(''), showToolbar = true }: Props = $props(); + let { class: + className = '', + content = $bindable(''), + showToolbar = true, + // html_text = '', + new_html = $bindable(''), + }: Props = $props(); let editor = $state(); let element = $state(); @@ -133,6 +141,12 @@ editor = transaction.editor; console.log(editor.isActive('bold')); content = editor.getHTML(); + console.log(content); + if (content == '

') { + new_html = ''; + } else { + new_html = content ?? ''; + } } }); }); diff --git a/src/lib/components/ui/button/button.svelte b/src/lib/components/ui/button/button.svelte new file mode 100644 index 00000000..8f44d5ce --- /dev/null +++ b/src/lib/components/ui/button/button.svelte @@ -0,0 +1,74 @@ + + + + +{#if href} + + {@render children?.()} + +{:else} + +{/if} diff --git a/src/lib/components/ui/button/index.js b/src/lib/components/ui/button/index.js new file mode 100644 index 00000000..07375978 --- /dev/null +++ b/src/lib/components/ui/button/index.js @@ -0,0 +1,9 @@ +import Root, { buttonVariants } from "./button.svelte"; + +export { + Root, + + // + Root as Button, + buttonVariants, +}; diff --git a/src/lib/components/ui/button/index.ts b/src/lib/components/ui/button/index.ts new file mode 100644 index 00000000..fb585d76 --- /dev/null +++ b/src/lib/components/ui/button/index.ts @@ -0,0 +1,17 @@ +import Root, { + type ButtonProps, + type ButtonSize, + type ButtonVariant, + buttonVariants, +} from "./button.svelte"; + +export { + Root, + type ButtonProps as Props, + // + Root as Button, + buttonVariants, + type ButtonProps, + type ButtonSize, + type ButtonVariant, +}; diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte new file mode 100644 index 00000000..20e3777b --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte @@ -0,0 +1,40 @@ + + + + {#snippet children({ checked, indeterminate })} + + {#if indeterminate} + + {:else} + + {/if} + + {@render childrenProp?.()} + {/snippet} + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte new file mode 100644 index 00000000..fdbaa471 --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte @@ -0,0 +1,26 @@ + + + + + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte new file mode 100644 index 00000000..84d5cca2 --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte @@ -0,0 +1,19 @@ + + + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte new file mode 100644 index 00000000..70a52361 --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte @@ -0,0 +1,23 @@ + + + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte new file mode 100644 index 00000000..9837d5a4 --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte @@ -0,0 +1,23 @@ + + +
+ {@render children?.()} +
diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte new file mode 100644 index 00000000..0f219da2 --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte @@ -0,0 +1,30 @@ + + + + {#snippet children({ checked })} + + {#if checked} + + {/if} + + {@render childrenProp?.({ checked })} + {/snippet} + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte new file mode 100644 index 00000000..32fac4bc --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte @@ -0,0 +1,16 @@ + + + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte new file mode 100644 index 00000000..053e2a2c --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte @@ -0,0 +1,20 @@ + + + + {@render children?.()} + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte new file mode 100644 index 00000000..0bb6eea4 --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte @@ -0,0 +1,19 @@ + + + diff --git a/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte b/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte new file mode 100644 index 00000000..c2dcd32e --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte @@ -0,0 +1,28 @@ + + + + {@render children?.()} + + diff --git a/src/lib/components/ui/dropdown-menu/index.js b/src/lib/components/ui/dropdown-menu/index.js new file mode 100644 index 00000000..40c45027 --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/index.js @@ -0,0 +1,50 @@ +import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui"; +import CheckboxItem from "./dropdown-menu-checkbox-item.svelte"; +import Content from "./dropdown-menu-content.svelte"; +import GroupHeading from "./dropdown-menu-group-heading.svelte"; +import Item from "./dropdown-menu-item.svelte"; +import Label from "./dropdown-menu-label.svelte"; +import RadioItem from "./dropdown-menu-radio-item.svelte"; +import Separator from "./dropdown-menu-separator.svelte"; +import Shortcut from "./dropdown-menu-shortcut.svelte"; +import SubContent from "./dropdown-menu-sub-content.svelte"; +import SubTrigger from "./dropdown-menu-sub-trigger.svelte"; + +const Sub = DropdownMenuPrimitive.Sub; +const Root = DropdownMenuPrimitive.Root; +const Trigger = DropdownMenuPrimitive.Trigger; +const Group = DropdownMenuPrimitive.Group; +const RadioGroup = DropdownMenuPrimitive.RadioGroup; + +export { + CheckboxItem, + Content, + Root as DropdownMenu, + CheckboxItem as DropdownMenuCheckboxItem, + Content as DropdownMenuContent, + Group as DropdownMenuGroup, + GroupHeading as DropdownMenuGroupHeading, + Item as DropdownMenuItem, + Label as DropdownMenuLabel, + RadioGroup as DropdownMenuRadioGroup, + RadioItem as DropdownMenuRadioItem, + Separator as DropdownMenuSeparator, + Shortcut as DropdownMenuShortcut, + Sub as DropdownMenuSub, + SubContent as DropdownMenuSubContent, + SubTrigger as DropdownMenuSubTrigger, + Trigger as DropdownMenuTrigger, + Group, + GroupHeading, + Item, + Label, + RadioGroup, + RadioItem, + Root, + Separator, + Shortcut, + Sub, + SubContent, + SubTrigger, + Trigger, +}; diff --git a/src/lib/components/ui/dropdown-menu/index.ts b/src/lib/components/ui/dropdown-menu/index.ts new file mode 100644 index 00000000..40c45027 --- /dev/null +++ b/src/lib/components/ui/dropdown-menu/index.ts @@ -0,0 +1,50 @@ +import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui"; +import CheckboxItem from "./dropdown-menu-checkbox-item.svelte"; +import Content from "./dropdown-menu-content.svelte"; +import GroupHeading from "./dropdown-menu-group-heading.svelte"; +import Item from "./dropdown-menu-item.svelte"; +import Label from "./dropdown-menu-label.svelte"; +import RadioItem from "./dropdown-menu-radio-item.svelte"; +import Separator from "./dropdown-menu-separator.svelte"; +import Shortcut from "./dropdown-menu-shortcut.svelte"; +import SubContent from "./dropdown-menu-sub-content.svelte"; +import SubTrigger from "./dropdown-menu-sub-trigger.svelte"; + +const Sub = DropdownMenuPrimitive.Sub; +const Root = DropdownMenuPrimitive.Root; +const Trigger = DropdownMenuPrimitive.Trigger; +const Group = DropdownMenuPrimitive.Group; +const RadioGroup = DropdownMenuPrimitive.RadioGroup; + +export { + CheckboxItem, + Content, + Root as DropdownMenu, + CheckboxItem as DropdownMenuCheckboxItem, + Content as DropdownMenuContent, + Group as DropdownMenuGroup, + GroupHeading as DropdownMenuGroupHeading, + Item as DropdownMenuItem, + Label as DropdownMenuLabel, + RadioGroup as DropdownMenuRadioGroup, + RadioItem as DropdownMenuRadioItem, + Separator as DropdownMenuSeparator, + Shortcut as DropdownMenuShortcut, + Sub as DropdownMenuSub, + SubContent as DropdownMenuSubContent, + SubTrigger as DropdownMenuSubTrigger, + Trigger as DropdownMenuTrigger, + Group, + GroupHeading, + Item, + Label, + RadioGroup, + RadioItem, + Root, + Separator, + Shortcut, + Sub, + SubContent, + SubTrigger, + Trigger, +}; diff --git a/src/lib/components/ui/input/index.js b/src/lib/components/ui/input/index.js new file mode 100644 index 00000000..f47b6d3f --- /dev/null +++ b/src/lib/components/ui/input/index.js @@ -0,0 +1,7 @@ +import Root from "./input.svelte"; + +export { + Root, + // + Root as Input, +}; diff --git a/src/lib/components/ui/input/index.ts b/src/lib/components/ui/input/index.ts new file mode 100644 index 00000000..f47b6d3f --- /dev/null +++ b/src/lib/components/ui/input/index.ts @@ -0,0 +1,7 @@ +import Root from "./input.svelte"; + +export { + Root, + // + Root as Input, +}; diff --git a/src/lib/components/ui/input/input.svelte b/src/lib/components/ui/input/input.svelte new file mode 100644 index 00000000..598829f3 --- /dev/null +++ b/src/lib/components/ui/input/input.svelte @@ -0,0 +1,22 @@ + + + diff --git a/src/lib/components/ui/popover/index.js b/src/lib/components/ui/popover/index.js new file mode 100644 index 00000000..63aecf9a --- /dev/null +++ b/src/lib/components/ui/popover/index.js @@ -0,0 +1,17 @@ +import { Popover as PopoverPrimitive } from "bits-ui"; +import Content from "./popover-content.svelte"; +const Root = PopoverPrimitive.Root; +const Trigger = PopoverPrimitive.Trigger; +const Close = PopoverPrimitive.Close; + +export { + Root, + Content, + Trigger, + Close, + // + Root as Popover, + Content as PopoverContent, + Trigger as PopoverTrigger, + Close as PopoverClose, +}; diff --git a/src/lib/components/ui/popover/index.ts b/src/lib/components/ui/popover/index.ts new file mode 100644 index 00000000..63aecf9a --- /dev/null +++ b/src/lib/components/ui/popover/index.ts @@ -0,0 +1,17 @@ +import { Popover as PopoverPrimitive } from "bits-ui"; +import Content from "./popover-content.svelte"; +const Root = PopoverPrimitive.Root; +const Trigger = PopoverPrimitive.Trigger; +const Close = PopoverPrimitive.Close; + +export { + Root, + Content, + Trigger, + Close, + // + Root as Popover, + Content as PopoverContent, + Trigger as PopoverTrigger, + Close as PopoverClose, +}; diff --git a/src/lib/components/ui/popover/popover-content.svelte b/src/lib/components/ui/popover/popover-content.svelte new file mode 100644 index 00000000..d2fbacee --- /dev/null +++ b/src/lib/components/ui/popover/popover-content.svelte @@ -0,0 +1,28 @@ + + + + + diff --git a/src/lib/components/ui/separator/index.js b/src/lib/components/ui/separator/index.js new file mode 100644 index 00000000..82442d2c --- /dev/null +++ b/src/lib/components/ui/separator/index.js @@ -0,0 +1,7 @@ +import Root from "./separator.svelte"; + +export { + Root, + // + Root as Separator, +}; diff --git a/src/lib/components/ui/separator/index.ts b/src/lib/components/ui/separator/index.ts new file mode 100644 index 00000000..82442d2c --- /dev/null +++ b/src/lib/components/ui/separator/index.ts @@ -0,0 +1,7 @@ +import Root from "./separator.svelte"; + +export { + Root, + // + Root as Separator, +}; diff --git a/src/lib/components/ui/separator/separator.svelte b/src/lib/components/ui/separator/separator.svelte new file mode 100644 index 00000000..839494d8 --- /dev/null +++ b/src/lib/components/ui/separator/separator.svelte @@ -0,0 +1,22 @@ + + + diff --git a/src/lib/components/ui/tooltip/index.js b/src/lib/components/ui/tooltip/index.js new file mode 100644 index 00000000..e9e1fd73 --- /dev/null +++ b/src/lib/components/ui/tooltip/index.js @@ -0,0 +1,18 @@ +import { Tooltip as TooltipPrimitive } from "bits-ui"; +import Content from "./tooltip-content.svelte"; + +const Root = TooltipPrimitive.Root; +const Trigger = TooltipPrimitive.Trigger; +const Provider = TooltipPrimitive.Provider; + +export { + Root, + Trigger, + Content, + Provider, + // + Root as Tooltip, + Content as TooltipContent, + Trigger as TooltipTrigger, + Provider as TooltipProvider, +}; diff --git a/src/lib/components/ui/tooltip/index.ts b/src/lib/components/ui/tooltip/index.ts new file mode 100644 index 00000000..e9e1fd73 --- /dev/null +++ b/src/lib/components/ui/tooltip/index.ts @@ -0,0 +1,18 @@ +import { Tooltip as TooltipPrimitive } from "bits-ui"; +import Content from "./tooltip-content.svelte"; + +const Root = TooltipPrimitive.Root; +const Trigger = TooltipPrimitive.Trigger; +const Provider = TooltipPrimitive.Provider; + +export { + Root, + Trigger, + Content, + Provider, + // + Root as Tooltip, + Content as TooltipContent, + Trigger as TooltipTrigger, + Provider as TooltipProvider, +}; diff --git a/src/lib/components/ui/tooltip/tooltip-content.svelte b/src/lib/components/ui/tooltip/tooltip-content.svelte new file mode 100644 index 00000000..68ff232b --- /dev/null +++ b/src/lib/components/ui/tooltip/tooltip-content.svelte @@ -0,0 +1,21 @@ + + + diff --git a/src/lib/element_tiptap_editor.svelte b/src/lib/element_tiptap_editor.svelte index d33e4eea..56265959 100644 --- a/src/lib/element_tiptap_editor.svelte +++ b/src/lib/element_tiptap_editor.svelte @@ -121,112 +121,112 @@ export let new_html: string = ''; onMount(() => { editor = new Editor({ - element: element, - extensions: [ - // StarterKit, - Bold, // part of StarterKit - Code, // part of StarterKit - CodeBlock, // part of StarterKit - Italic, // part of StarterKit - Strike, // part of StarterKit - Underline, // part of StarterKit - BulletList, // part of StarterKit - // Color.configure({ types: [TextStyle.name, ListItem.name] }), - // TextStyle.configure({ types: [ListItem.name] }), - // Heading.configure({ levels: [1, 2, 3, 4, 5, 6] }), - Highlight, - History.configure({ - depth: 100, - newGroupDelay: 500 - }), - Link.configure({ - openOnClick: false, - autolink: true, - defaultProtocol: 'https', - protocols: ['http', 'https'], - isAllowedUri: (url, ctx) => { - try { - // construct URL - const parsedUrl = url.includes(':') ? new URL(url) : new URL(`${ctx.defaultProtocol}://${url}`) + // element: element, + // extensions: [ + // // StarterKit, + // Bold, // part of StarterKit + // Code, // part of StarterKit + // CodeBlock, // part of StarterKit + // Italic, // part of StarterKit + // Strike, // part of StarterKit + // Underline, // part of StarterKit + // BulletList, // part of StarterKit + // // Color.configure({ types: [TextStyle.name, ListItem.name] }), + // // TextStyle.configure({ types: [ListItem.name] }), + // // Heading.configure({ levels: [1, 2, 3, 4, 5, 6] }), + // Highlight, + // History.configure({ + // depth: 100, + // newGroupDelay: 500 + // }), + // Link.configure({ + // openOnClick: false, + // autolink: true, + // defaultProtocol: 'https', + // protocols: ['http', 'https'], + // isAllowedUri: (url, ctx) => { + // try { + // // construct URL + // const parsedUrl = url.includes(':') ? new URL(url) : new URL(`${ctx.defaultProtocol}://${url}`) - // use default validation - if (!ctx.defaultValidate(parsedUrl.href)) { - return false - } + // // use default validation + // if (!ctx.defaultValidate(parsedUrl.href)) { + // return false + // } - // disallowed protocols - const disallowedProtocols = ['ftp', 'file', 'mailto'] - const protocol = parsedUrl.protocol.replace(':', '') + // // disallowed protocols + // const disallowedProtocols = ['ftp', 'file', 'mailto'] + // const protocol = parsedUrl.protocol.replace(':', '') - if (disallowedProtocols.includes(protocol)) { - return false - } + // if (disallowedProtocols.includes(protocol)) { + // return false + // } - // only allow protocols specified in ctx.protocols - const allowedProtocols = ctx.protocols.map(p => (typeof p === 'string' ? p : p.scheme)) + // // only allow protocols specified in ctx.protocols + // const allowedProtocols = ctx.protocols.map(p => (typeof p === 'string' ? p : p.scheme)) - if (!allowedProtocols.includes(protocol)) { - return false - } + // if (!allowedProtocols.includes(protocol)) { + // return false + // } - // disallowed domains - const disallowedDomains = ['example-phishing.com', 'malicious-site.net'] - const domain = parsedUrl.hostname + // // disallowed domains + // const disallowedDomains = ['example-phishing.com', 'malicious-site.net'] + // const domain = parsedUrl.hostname - if (disallowedDomains.includes(domain)) { - return false - } + // if (disallowedDomains.includes(domain)) { + // return false + // } - // all checks have passed - return true - } catch (error) { - return false - } - }, - shouldAutoLink: url => { - try { - // construct URL - const parsedUrl = url.includes(':') ? new URL(url) : new URL(`https://${url}`) + // // all checks have passed + // return true + // } catch (error) { + // return false + // } + // }, + // shouldAutoLink: url => { + // try { + // // construct URL + // const parsedUrl = url.includes(':') ? new URL(url) : new URL(`https://${url}`) - // only auto-link if the domain is not in the disallowed list - const disallowedDomains = ['example-no-autolink.com', 'another-no-autolink.com'] - const domain = parsedUrl.hostname + // // only auto-link if the domain is not in the disallowed list + // const disallowedDomains = ['example-no-autolink.com', 'another-no-autolink.com'] + // const domain = parsedUrl.hostname - return !disallowedDomains.includes(domain) - } catch (error) { - return false - } - }, - }), - ListItem, - Document, - OrderedList, // part of StarterKit - Paragraph, - Text, - Typography, - ], - content: html_text, - onTransaction: ({ editor, transaction }) => { - // console.log('onTransaction'); - // force re-render so `editor.isActive` works as expected - // editor = editor; + // return !disallowedDomains.includes(domain) + // } catch (error) { + // return false + // } + // }, + // }), + // ListItem, + // Document, + // OrderedList, // part of StarterKit + // Paragraph, + // Text, + // Typography, + // ], + // content: html_text, + // onTransaction: ({ editor, transaction }) => { + // // console.log('onTransaction'); + // // force re-render so `editor.isActive` works as expected + // // editor = editor; - // let updated_html = editor.getHTML(); - // if (updated_html == '

') { - // new_html = ''; - // } else { - // new_html = updated_html; - // } - }, - onUpdate: ({ editor }) => { - console.log('onUpdate', editor.getHTML()); - let updated_html = editor.getHTML(); - if (updated_html == '

') { - new_html = ''; - } else { - new_html = updated_html; - } - } + // // let updated_html = editor.getHTML(); + // // if (updated_html == '

') { + // // new_html = ''; + // // } else { + // // new_html = updated_html; + // // } + // }, + // onUpdate: ({ editor }) => { + // // console.log('onUpdate', editor.getHTML()); + // // let updated_html = editor.getHTML(); + // // if (updated_html == '

') { + // // new_html = ''; + // // } else { + // // new_html = updated_html; + // // } + // } }); }); @@ -248,9 +248,11 @@ let mouse_enter_wait: number = 500; let mouse_leave_wait: number = 2000; + +{#if 1==3}
{ if (default_minimal) { @@ -285,6 +287,7 @@ let mouse_leave_wait: number = 2000; // } }} class="editor textarea p-1 transition-all duration-1000" + class:hidden={true} > @@ -619,8 +622,16 @@ let mouse_leave_wait: number = 2000; >{placeholder}
- +{/if} + +
+ +