@brightsideoy/kama 1.0.0-alpha.17 → 1.0.0-alpha.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +70 -44
- package/content/definitions/block-kama-forms.yaml +5 -0
- package/content/definitions/blocks/node-list.yaml +8 -0
- package/content/forms/contact.yaml +44 -0
- package/content/forms/subscription.yaml +32 -0
- package/dist/assets/AssetEditor-CY9SjGaJ.js +1 -0
- package/dist/assets/CmsBadge-BNsgxyyB.css +1 -0
- package/dist/assets/CmsBadge-D0Ob9qPU.js +1 -0
- package/dist/assets/CmsButton-BQ85-YXn.css +1 -0
- package/dist/assets/CmsButton-CbOfxvjr.js +1 -0
- package/dist/assets/CmsDataRow--H4iI_u_.js +1 -0
- package/dist/assets/CmsDataRow-CYNxfVaZ.css +1 -0
- package/dist/assets/CmsHelp-DJSdFYVH.js +1 -0
- package/dist/assets/CmsImagePreview-CujwG8r_.css +1 -0
- package/dist/assets/CmsImagePreview-DuHPBzml.js +1 -0
- package/dist/assets/CmsPaneResizer-B62ZqsnE.js +1 -0
- package/dist/assets/CmsPaneResizer-Dkidd4pI.css +1 -0
- package/dist/assets/CmsPublisher-DBcCz-AD.js +3 -0
- package/dist/assets/CmsUserCenter-D3XDzKDC.js +1 -0
- package/dist/assets/EditorSplitPreview-wCnwVnnb.js +1 -0
- package/dist/assets/NodeContextMenu-BYeWzmQ5.css +1 -0
- package/dist/assets/NodeContextMenu-C_HWBGeb.js +1 -0
- package/dist/assets/NodeEditor-D3tAGViP.js +147 -0
- package/dist/assets/NodeEditor-DlfAHtiG.css +1 -0
- package/dist/assets/StatusPill-CbeW5SMT.js +1 -0
- package/dist/assets/StatusPill-Dlm6uvGe.css +1 -0
- package/dist/assets/TrashWorkspace--uFsWt53.js +1 -0
- package/dist/assets/{_plugin-vue_export-helper-CTn6xl4w.js → _plugin-vue_export-helper-CQxWhVtr.js} +1 -1
- package/dist/assets/circle-check-A-QeFqt3.js +1 -0
- package/dist/assets/database-hg5SqKLG.js +1 -0
- package/dist/assets/folder-tree-BWYot72H.js +1 -0
- package/dist/assets/globe-BraoljaN.js +1 -0
- package/dist/assets/{history-XvWNE5zO.js → history-pqIbKK9u.js} +1 -1
- package/dist/assets/index-AQYAbg3R.js +14 -0
- package/dist/assets/index-DcKiaRjI.css +1 -0
- package/dist/assets/{layers-D0DLWjff.js → layers-B6RgfpPR.js} +1 -1
- package/dist/assets/loader-circle-BoUkhDjq.js +1 -0
- package/dist/assets/monitor-CrpvInqG.js +1 -0
- package/dist/assets/panel-left-close-CVFakVaA.js +1 -0
- package/dist/assets/plus-mqZr4I1D.js +1 -0
- package/dist/assets/rotate-ccw-CWE4pOjs.js +1 -0
- package/dist/assets/{save-C8e-QRkP.js → save-Ctv8vW9H.js} +1 -1
- package/dist/assets/schema-helpers-1UXlO0Ye.js +1 -0
- package/dist/assets/send-F-mJeL54.js +1 -0
- package/dist/assets/{smartphone-Wy6xQi_i.js → smartphone-EPce6VdP.js} +1 -1
- package/dist/assets/trash-2-CAUF1KtI.js +1 -0
- package/dist/assets/useLocalStorage-C805uplI.js +1 -0
- package/dist/assets/useNodes-W5j_uxdQ.js +1 -0
- package/dist/assets/user-IFlT6mYq.js +1 -0
- package/dist/{dist-BGv2bzzF.js → dist-Bta0OpXl.js} +145 -30
- package/dist/index.html +34 -3
- package/dist/index.js +145 -30
- package/dist/schema-compiler.js +1 -1
- package/documentation/EXTENSIONS.md +204 -0
- package/extension-registry.js +5 -0
- package/package.json +3 -1
- package/templates/astro-starter/old_src/components/blocks/BlockRenderer.astro +143 -0
- package/templates/astro-starter/old_src/components/blocks/ColumnLayout.astro +67 -0
- package/templates/astro-starter/old_src/components/blocks/HeaderImage.astro +126 -0
- package/templates/astro-starter/old_src/components/blocks/Hero.astro +218 -0
- package/templates/astro-starter/old_src/components/blocks/HtmlBlock.astro +25 -0
- package/templates/astro-starter/old_src/components/blocks/ImageBlock.astro +91 -0
- package/templates/astro-starter/old_src/components/blocks/NodeList.astro +274 -0
- package/templates/astro-starter/old_src/components/blocks/TextBlock.astro +15 -0
- package/templates/astro-starter/old_src/components/global/Breadcrumb.astro +108 -0
- package/templates/astro-starter/old_src/components/global/Footer.astro +50 -0
- package/templates/astro-starter/old_src/components/global/Header.astro +171 -0
- package/templates/astro-starter/old_src/components/global/MetaHead.astro +266 -0
- package/templates/astro-starter/old_src/components/global/NavigationMenu.astro +413 -0
- package/templates/astro-starter/old_src/components/ui/KamaImage.astro +180 -0
- package/templates/astro-starter/old_src/layouts/SkeletonLayout.astro +56 -0
- package/templates/astro-starter/old_src/layouts/StandardLayout.astro +63 -0
- package/templates/astro-starter/old_src/lib/cms.ts +219 -0
- package/templates/astro-starter/old_src/lib/media/kama-image-service.ts +67 -0
- package/templates/astro-starter/old_src/lib/media/media-proxy.ts +148 -0
- package/templates/astro-starter/old_src/lib/media/media-url.ts +112 -0
- package/templates/astro-starter/old_src/middleware.ts +536 -0
- package/templates/astro-starter/old_src/pages/404.astro +46 -0
- package/templates/astro-starter/old_src/pages/[...slug].astro +311 -0
- package/templates/astro-starter/old_src/pages/api/load-nodes.ts +68 -0
- package/templates/astro-starter/old_src/pages/api/partials/node-cards.astro +101 -0
- package/templates/astro-starter/old_src/pages/llms-full.txt.ts +171 -0
- package/templates/astro-starter/old_src/pages/llms.txt.ts +113 -0
- package/templates/astro-starter/old_src/pages/media/[...path].ts +14 -0
- package/templates/astro-starter/old_src/pages/partials/footer.astro +69 -0
- package/templates/astro-starter/old_src/pages/partials/nav.astro +141 -0
- package/templates/astro-starter/old_src/styles/standard-theme.css +157 -0
- package/templates/astro-starter/old_src/utils/tiptap.ts +113 -0
- package/templates/astro-starter/src/components/blocks/Form.astro +143 -0
- package/templates/kama-worker/index.js +35 -12
- package/templates/kama-worker/server.js +2 -0
- package/dist/assets/AssetEditor-CCNDGlQ_.js +0 -1
- package/dist/assets/CmsHelp-m9EOY_nE.js +0 -1
- package/dist/assets/CmsPublisher-Cs_ys68V.js +0 -3
- package/dist/assets/CmsUserCenter-D-T6HyWF.js +0 -1
- package/dist/assets/EditorSplitPreview-CnWpXZWQ.js +0 -1
- package/dist/assets/NodeEditor-B1TvB2eW.css +0 -1
- package/dist/assets/NodeEditor-CZGnkwvf.js +0 -147
- package/dist/assets/TrashWorkspace-CERX58Ek.js +0 -1
- package/dist/assets/index-BpOAL4tE.js +0 -14
- package/dist/assets/index-C-EkPNvq.css +0 -1
- package/dist/assets/link-Bs_SUS0O.js +0 -1
- package/dist/assets/rotate-ccw-CvD7yNQj.js +0 -1
package/bin/cli.js
CHANGED
|
@@ -3,12 +3,10 @@ import { execSync } from 'node:child_process';
|
|
|
3
3
|
import { existsSync, mkdirSync, writeFileSync, readFileSync, readdirSync, cpSync, unlinkSync, appendFileSync } from 'node:fs';
|
|
4
4
|
import { join, dirname, basename, resolve } from 'node:path';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
|
-
import crypto from 'node:crypto';
|
|
6
|
+
import crypto from 'node:crypto';
|
|
7
7
|
|
|
8
|
-
// 🎯 Modern CLI UI Components
|
|
9
8
|
import { intro, outro, text, password, select, confirm, spinner, note, isCancel, cancel } from '@clack/prompts';
|
|
10
9
|
|
|
11
|
-
// --- UI HELPERS (Zero Dependency Colors) ---
|
|
12
10
|
const pc = {
|
|
13
11
|
green: (t) => `\x1b[32m${t}\x1b[0m`,
|
|
14
12
|
cyan: (t) => `\x1b[36m${t}\x1b[0m`,
|
|
@@ -20,7 +18,6 @@ const pc = {
|
|
|
20
18
|
reset: '\x1b[0m'
|
|
21
19
|
};
|
|
22
20
|
|
|
23
|
-
// Graceful exit handler for Ctrl+C
|
|
24
21
|
function handleCancel(value) {
|
|
25
22
|
if (isCancel(value)) {
|
|
26
23
|
cancel('Operation cancelled.');
|
|
@@ -29,13 +26,11 @@ function handleCancel(value) {
|
|
|
29
26
|
return value;
|
|
30
27
|
}
|
|
31
28
|
|
|
32
|
-
// 🎯 Always use the absolute newest ecosystem
|
|
33
29
|
const ASTRO_LATEST = "latest";
|
|
34
30
|
const ASTRO_NODE_LATEST = "latest";
|
|
35
31
|
const ASTRO_CF_LATEST = "latest";
|
|
36
32
|
const WRANGLER_LATEST = "latest";
|
|
37
33
|
|
|
38
|
-
// Dynamically resolve current package version
|
|
39
34
|
const __filename = fileURLToPath(import.meta.url);
|
|
40
35
|
const __dirname = dirname(__filename);
|
|
41
36
|
let currentKamaVersion = 'alpha';
|
|
@@ -49,29 +44,22 @@ try {
|
|
|
49
44
|
console.warn("⚠️ Could not detect Kama version, defaulting to 'alpha'");
|
|
50
45
|
}
|
|
51
46
|
|
|
52
|
-
/**
|
|
53
|
-
- 🎯 SECURE SECRET MANAGER
|
|
54
|
-
- Gracefully retrieves an existing workspace secret, or generates and injects one if missing.
|
|
55
|
-
*/
|
|
56
47
|
function getOrGenerateWorkspaceSecret(workerDir) {
|
|
57
48
|
const envPath = join(workerDir, '.env');
|
|
58
49
|
const devVarsPath = join(workerDir, '.dev.vars');
|
|
59
50
|
|
|
60
51
|
let secret = null;
|
|
61
52
|
|
|
62
|
-
// Check local Node .env
|
|
63
53
|
if (existsSync(envPath)) {
|
|
64
54
|
const match = readFileSync(envPath, 'utf-8').match(/^FRONTEND_API_SECRET=["']?([^"'\n]+)/m);
|
|
65
55
|
if (match) secret = match[1];
|
|
66
56
|
}
|
|
67
57
|
|
|
68
|
-
// Check Cloudflare .dev.vars
|
|
69
58
|
if (!secret && existsSync(devVarsPath)) {
|
|
70
59
|
const match = readFileSync(devVarsPath, 'utf-8').match(/^FRONTEND_API_SECRET=["']?([^"'\n]+)/m);
|
|
71
60
|
if (match) secret = match[1];
|
|
72
61
|
}
|
|
73
62
|
|
|
74
|
-
// Generate and inject if missing
|
|
75
63
|
if (!secret) {
|
|
76
64
|
secret = crypto.randomBytes(32).toString('hex');
|
|
77
65
|
const secretLine = `\n# KAMA Auto-Generated Server-to-Server Security\nFRONTEND_API_SECRET="${secret}"\n`;
|
|
@@ -88,9 +76,6 @@ function getOrGenerateWorkspaceSecret(workerDir) {
|
|
|
88
76
|
return secret;
|
|
89
77
|
}
|
|
90
78
|
|
|
91
|
-
/**
|
|
92
|
-
- 🎯 BULLETPROOF WRANGLER EXECUTION RESOLVER
|
|
93
|
-
*/
|
|
94
79
|
function getWranglerCmd() {
|
|
95
80
|
try {
|
|
96
81
|
execSync('wrangler --version', { stdio: 'ignore' });
|
|
@@ -100,13 +85,10 @@ function getWranglerCmd() {
|
|
|
100
85
|
}
|
|
101
86
|
}
|
|
102
87
|
|
|
103
|
-
/**
|
|
104
|
-
- 🎯 ROBUST WRANGLER RUNNER
|
|
105
|
-
*/
|
|
106
88
|
function runWrangler(cmd, options = {}) {
|
|
107
89
|
const baseWrangler = getWranglerCmd();
|
|
108
90
|
try {
|
|
109
|
-
const result = execSync(`${baseWrangler}
|
|
91
|
+
const result = execSync(`${baseWrangler}${cmd}`, {
|
|
110
92
|
encoding: 'utf-8',
|
|
111
93
|
stdio: options.stdio || 'pipe',
|
|
112
94
|
input: options.input,
|
|
@@ -269,6 +251,61 @@ function updateEnvFile(filePath, values, removeKeys = []) {
|
|
|
269
251
|
writeFileSync(filePath, `${lines.filter((line, index) => line || index < lines.length - 1).join('\n')}\n`);
|
|
270
252
|
}
|
|
271
253
|
|
|
254
|
+
function generateExtensionRegistry(rootDir) {
|
|
255
|
+
const workerDir = join(rootDir, 'kama-worker');
|
|
256
|
+
const extDir = join(rootDir, 'extensions');
|
|
257
|
+
const registryPath = join(workerDir, 'extension-registry.js');
|
|
258
|
+
|
|
259
|
+
let imports = '';
|
|
260
|
+
let arrayElements = [];
|
|
261
|
+
|
|
262
|
+
if (existsSync(extDir)) {
|
|
263
|
+
const folders = readdirSync(extDir, { withFileTypes: true })
|
|
264
|
+
.filter(dirent => dirent.isDirectory())
|
|
265
|
+
.map(dirent => dirent.name);
|
|
266
|
+
|
|
267
|
+
folders.forEach((folder, i) => {
|
|
268
|
+
const tsPath = join(extDir, folder, 'index.ts');
|
|
269
|
+
const jsPath = join(extDir, folder, 'index.js');
|
|
270
|
+
let extFile = '';
|
|
271
|
+
|
|
272
|
+
if (existsSync(tsPath)) extFile = 'index.ts';
|
|
273
|
+
else if (existsSync(jsPath)) extFile = 'index.js';
|
|
274
|
+
|
|
275
|
+
if (extFile) {
|
|
276
|
+
imports += `import ext_${i} from '../extensions/${folder}/${extFile}';\n`;
|
|
277
|
+
arrayElements.push(`ext_${i}`);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// Auto-inject extension schemas into the workspace definitions
|
|
281
|
+
const defDir = join(extDir, folder, 'definitions');
|
|
282
|
+
if (existsSync(defDir)) {
|
|
283
|
+
cpSync(defDir, join(rootDir, 'content', 'definitions'), { recursive: true });
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// 🎯 Enterprise Static Asset Sync for Extensions
|
|
287
|
+
// Syncs extension UI dist/ui static assets into the ASSETS directory served by Cloudflare Wrangler
|
|
288
|
+
const extUiDir = join(extDir, folder, 'ui');
|
|
289
|
+
const extDistDir = join(extDir, folder, 'dist');
|
|
290
|
+
const targetAssetDir = join(rootDir, 'node_modules', '@brightsideoy', 'kama', 'dist', 'ext', folder);
|
|
291
|
+
|
|
292
|
+
if (existsSync(extDistDir)) {
|
|
293
|
+
mkdirSync(targetAssetDir, { recursive: true });
|
|
294
|
+
cpSync(extDistDir, targetAssetDir, { recursive: true });
|
|
295
|
+
} else if (existsSync(extUiDir)) {
|
|
296
|
+
mkdirSync(targetAssetDir, { recursive: true });
|
|
297
|
+
cpSync(extUiDir, targetAssetDir, { recursive: true });
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const fileContent = `// 🤖 AUTO-GENERATED - DO NOT EDIT\n${imports}\nexport const activeExtensions = [\n${arrayElements.join(',\n ')}\n];\n`;
|
|
303
|
+
|
|
304
|
+
if (existsSync(workerDir)) {
|
|
305
|
+
writeFileSync(registryPath, fileContent, 'utf-8');
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
272
309
|
function showHelp() {
|
|
273
310
|
console.log(`\n${pc.bgCyan(' KAMA • ENGINE CLI ')}\n`);
|
|
274
311
|
console.log('Usage: npx kama <command> [options]\n');
|
|
@@ -350,9 +387,6 @@ function convertAstroConfigToCloudflare(siteDir) {
|
|
|
350
387
|
}
|
|
351
388
|
}
|
|
352
389
|
|
|
353
|
-
/**
|
|
354
|
-
- COMMAND: npx kama init
|
|
355
|
-
*/
|
|
356
390
|
async function createFullWorkspace() {
|
|
357
391
|
const cwdName = basename(process.cwd());
|
|
358
392
|
const hasExistingPkg = existsSync(join(process.cwd(), 'package.json'));
|
|
@@ -416,7 +450,6 @@ async function createFullWorkspace() {
|
|
|
416
450
|
const cmsProtocol = isCloudflare ? 'https://' : 'http://';
|
|
417
451
|
const cmsFullUrl = cmsDomain ? `${cmsProtocol}${cmsDomain.replace(/^https?:\/\//, '')}` : 'http://localhost:8787';
|
|
418
452
|
|
|
419
|
-
// 🎯 INITIALIZE UNIQUE SECURE API SECRET
|
|
420
453
|
const frontendApiSecret = crypto.randomBytes(32).toString('hex');
|
|
421
454
|
|
|
422
455
|
const workerName = `${projName}-worker`.toLowerCase().replace(/[^a-z0-9_-]/g, '-');
|
|
@@ -432,7 +465,7 @@ async function createFullWorkspace() {
|
|
|
432
465
|
'node_modules/', '.env', '.DS_Store', 'kama-worker/.dev.vars', 'kama-worker/.secrets',
|
|
433
466
|
'kama-worker/.env', 'kama-worker/.wrangler/', 'kama-worker/public/', 'kama-worker/*.db',
|
|
434
467
|
'sites/*/.env', 'sites/*/.secrets', 'sites/*/.astro/', 'sites/*/dist/',
|
|
435
|
-
'kama-worker/bundled-definitions.js'
|
|
468
|
+
'kama-worker/bundled-definitions.js', 'kama-worker/extension-registry.js'
|
|
436
469
|
]);
|
|
437
470
|
|
|
438
471
|
const sourceDefsDir = join(__dirname, '../content/definitions');
|
|
@@ -488,6 +521,7 @@ async function createFullWorkspace() {
|
|
|
488
521
|
|
|
489
522
|
const emptyDefs = `{ nodes: {}, trees: {}, blocks: {}, nodeLayouts: {}, blockLayouts: {}, channels: {} }`;
|
|
490
523
|
writeFileSync(join(cmsDir, 'bundled-definitions.js'), `const defs = ${emptyDefs};\nexport const BUNDLED_DEFINITIONS = defs;\nexport default defs;\n`);
|
|
524
|
+
writeFileSync(join(cmsDir, 'extension-registry.js'), `export const activeExtensions = [];\n`);
|
|
491
525
|
|
|
492
526
|
if (isCloudflare) {
|
|
493
527
|
const templateIndexPath = join(__dirname, '../templates/kama-worker/index.js');
|
|
@@ -508,7 +542,7 @@ async function createFullWorkspace() {
|
|
|
508
542
|
"dev": "wrangler dev --port 8787 --inspector-port 9239",
|
|
509
543
|
"deploy": "npm run setup:remote && wrangler deploy --secrets-file .secrets"
|
|
510
544
|
},
|
|
511
|
-
dependencies: { '@brightsideoy/kama': currentKamaVersion, '@libsql/client': '^0.14.0' },
|
|
545
|
+
dependencies: { '@brightsideoy/kama': currentKamaVersion, 'hono': '^4.13.0', '@libsql/client': '^0.14.0' },
|
|
512
546
|
devDependencies: { "wrangler": WRANGLER_LATEST },
|
|
513
547
|
}, null, 2)
|
|
514
548
|
);
|
|
@@ -558,7 +592,7 @@ async function createFullWorkspace() {
|
|
|
558
592
|
"dev": "tsx server.js",
|
|
559
593
|
"start": "node server.js"
|
|
560
594
|
},
|
|
561
|
-
dependencies: { '@brightsideoy/kama': currentKamaVersion, '@hono/node-server': '^1.13.0', '@libsql/client': '^0.14.0', 'sharp': '^0.33.5', 'dotenv': '^16.4.5' },
|
|
595
|
+
dependencies: { '@brightsideoy/kama': currentKamaVersion, 'hono': '^4.13.0', '@hono/node-server': '^1.13.0', '@libsql/client': '^0.14.0', 'sharp': '^0.33.5', 'dotenv': '^16.4.5' },
|
|
562
596
|
devDependencies: { "tsx": "^4.19.0" },
|
|
563
597
|
}, null, 2)
|
|
564
598
|
);
|
|
@@ -598,9 +632,6 @@ async function createFullWorkspace() {
|
|
|
598
632
|
outro(`KAMA • ENGINE is ready! 🚀`);
|
|
599
633
|
}
|
|
600
634
|
|
|
601
|
-
/**
|
|
602
|
-
- COMMAND: npx kama add site
|
|
603
|
-
*/
|
|
604
635
|
async function createNewSiteOnly() {
|
|
605
636
|
const rootDir = process.cwd();
|
|
606
637
|
|
|
@@ -670,29 +701,26 @@ async function createNewSiteOnly() {
|
|
|
670
701
|
outro('Site added successfully! 🚀');
|
|
671
702
|
}
|
|
672
703
|
|
|
673
|
-
/**
|
|
674
|
-
- COMMAND: npx kama bundle
|
|
675
|
-
*/
|
|
676
704
|
async function bundleWorkspaceSchemas(targetRootDir, silent = false) {
|
|
677
705
|
let rootDir = targetRootDir || process.cwd();
|
|
678
706
|
if (basename(rootDir) === 'kama-worker') rootDir = resolve(rootDir, '..');
|
|
679
707
|
|
|
680
708
|
const s = spinner();
|
|
681
|
-
if (!silent) s.start('Bundling schemas...');
|
|
709
|
+
if (!silent) s.start('Bundling schemas & extensions...');
|
|
682
710
|
try {
|
|
711
|
+
generateExtensionRegistry(rootDir);
|
|
712
|
+
|
|
683
713
|
let compilerPath = join(__dirname, '../dist/schema-compiler.js');
|
|
684
714
|
if (!existsSync(compilerPath)) compilerPath = join(__dirname, '../scripts/schema-compiler.ts');
|
|
685
715
|
execSync(`${shellQuote(process.execPath)} ${shellQuote(compilerPath)}`, { cwd: rootDir, stdio: 'inherit' });
|
|
686
|
-
|
|
716
|
+
|
|
717
|
+
if (!silent) s.stop('Schemas and Extensions bundled successfully.');
|
|
687
718
|
} catch (e) {
|
|
688
|
-
if (!silent) s.stop(`
|
|
719
|
+
if (!silent) s.stop(`Compilation failed: ${e.message}`, true);
|
|
689
720
|
else throw e;
|
|
690
721
|
}
|
|
691
722
|
}
|
|
692
723
|
|
|
693
|
-
/**
|
|
694
|
-
- COMMAND: npx kama promote
|
|
695
|
-
*/
|
|
696
724
|
async function promoteLocalToCloudflare() {
|
|
697
725
|
const rootDir = process.cwd();
|
|
698
726
|
const workerDir = join(rootDir, 'kama-worker');
|
|
@@ -799,10 +827,12 @@ async function promoteLocalToCloudflare() {
|
|
|
799
827
|
workerPkg.scripts["setup:remote"] = `wrangler d1 execute ${dbName} --remote --file=../node_modules/@brightsideoy/kama/schema.sql`;
|
|
800
828
|
|
|
801
829
|
workerPkg.scripts["seed"] = "npm run seed:local";
|
|
802
|
-
// 🎯 3. ARCHITECTURE FIX: Chunked seed loops for promoted worker
|
|
803
830
|
workerPkg.scripts["seed:local"] = `node ../node_modules/@brightsideoy/kama/dist/build-seed.js && for f in seed-*.sql; do wrangler d1 execute ${dbName} --local --file="$f"; done`;
|
|
804
831
|
workerPkg.scripts["seed:remote"] = `node ../node_modules/@brightsideoy/kama/dist/build-seed.js && for f in seed-*.sql; do wrangler d1 execute ${dbName} --remote --file="$f"; done`;
|
|
805
832
|
|
|
833
|
+
workerPkg.dependencies = workerPkg.dependencies || {};
|
|
834
|
+
workerPkg.dependencies.hono = '^4.13.0';
|
|
835
|
+
|
|
806
836
|
workerPkg.devDependencies = workerPkg.devDependencies || {};
|
|
807
837
|
workerPkg.devDependencies.wrangler = WRANGLER_LATEST;
|
|
808
838
|
if (workerPkg.devDependencies.tsx) delete workerPkg.devDependencies.tsx;
|
|
@@ -826,7 +856,6 @@ async function promoteLocalToCloudflare() {
|
|
|
826
856
|
assets: { directory: "./dist/client", binding: "ASSETS", run_worker_first: true },
|
|
827
857
|
kv_namespaces: [{ binding: "SESSION", id: sessionId }, { binding: "HTML_CACHE", id: htmlCacheId }],
|
|
828
858
|
services: [{ binding: "CMS_WORKER", service: currentConfig.name }],
|
|
829
|
-
// 🎯 2. ARCHITECTURE FIX: Removed strict zone_name requirement
|
|
830
859
|
routes: [{ pattern: siteDomain, custom_domain: true, enabled: true, previews_enabled: false }],
|
|
831
860
|
vars: { PUBLIC_CMS_URL: `https://${cmsDomain}`, PUBLIC_API_URL: `https://${cmsDomain}` }
|
|
832
861
|
};
|
|
@@ -872,9 +901,6 @@ async function promoteLocalToCloudflare() {
|
|
|
872
901
|
outro('Promotion complete.');
|
|
873
902
|
}
|
|
874
903
|
|
|
875
|
-
/**
|
|
876
|
-
- Helper: Copies the Astro starter template and hydrates runtime tokens
|
|
877
|
-
*/
|
|
878
904
|
async function generateAstroSite(rootDir, siteFolder, siteDomain, cmsFullUrl, workerName = 'kama-worker', isCloudflare = false, frontendApiSecret = '') {
|
|
879
905
|
const siteDir = join(rootDir, 'sites', siteFolder);
|
|
880
906
|
const templateDir = join(__dirname, '../templates/astro-starter');
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
id: contact-form
|
|
2
|
+
title: Contact Us
|
|
3
|
+
description: General contact form for customer inquiries
|
|
4
|
+
|
|
5
|
+
settings:
|
|
6
|
+
saveToDatabase: true
|
|
7
|
+
requireTurnstile: true
|
|
8
|
+
successMessage: "Thank you for reaching out! We will get back to you shortly."
|
|
9
|
+
notifications:
|
|
10
|
+
email:
|
|
11
|
+
enabled: true
|
|
12
|
+
to: "admin@example.com"
|
|
13
|
+
subject: "New Contact Form Submission from {{fullName}}"
|
|
14
|
+
|
|
15
|
+
fields:
|
|
16
|
+
- name: fullName
|
|
17
|
+
label: Full Name
|
|
18
|
+
type: text
|
|
19
|
+
placeholder: "John Doe"
|
|
20
|
+
required: true
|
|
21
|
+
|
|
22
|
+
- name: email
|
|
23
|
+
label: Email Address
|
|
24
|
+
type: email
|
|
25
|
+
placeholder: "john@example.com"
|
|
26
|
+
required: true
|
|
27
|
+
|
|
28
|
+
- name: subject
|
|
29
|
+
label: Subject
|
|
30
|
+
type: select
|
|
31
|
+
required: true
|
|
32
|
+
options:
|
|
33
|
+
- label: General Inquiry
|
|
34
|
+
value: general
|
|
35
|
+
- label: Technical Support
|
|
36
|
+
value: support
|
|
37
|
+
- label: Sales & Billing
|
|
38
|
+
value: sales
|
|
39
|
+
|
|
40
|
+
- name: message
|
|
41
|
+
label: Message
|
|
42
|
+
type: textarea
|
|
43
|
+
placeholder: "How can we help you?"
|
|
44
|
+
required: true
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
id: subscription-form
|
|
2
|
+
title: Subscription
|
|
3
|
+
description: Newsletter subscription - form for users to sign up for updates
|
|
4
|
+
|
|
5
|
+
settings:
|
|
6
|
+
saveToDatabase: true
|
|
7
|
+
requireTurnstile: true
|
|
8
|
+
successMessage: "Thank you for subscribing! We will get back to you shortly."
|
|
9
|
+
notifications:
|
|
10
|
+
email:
|
|
11
|
+
enabled: true
|
|
12
|
+
to: "admin@example.com"
|
|
13
|
+
subject: "New Contact Form Submission from {{fullName}}"
|
|
14
|
+
|
|
15
|
+
fields:
|
|
16
|
+
- name: firstName
|
|
17
|
+
label: First Name
|
|
18
|
+
type: text
|
|
19
|
+
placeholder:
|
|
20
|
+
required: true
|
|
21
|
+
|
|
22
|
+
- name: lastName
|
|
23
|
+
label: Last Name
|
|
24
|
+
type: text
|
|
25
|
+
placeholder:
|
|
26
|
+
required: true
|
|
27
|
+
|
|
28
|
+
- name: email
|
|
29
|
+
label: Email Address
|
|
30
|
+
type: email
|
|
31
|
+
placeholder: "john@example.com"
|
|
32
|
+
required: true
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,B as t,E as n,Et as r,I as i,K as a,O as o,R as s,S as c,St as ee,T as l,Y as u,b as d,f,g as p,j as m,lt as h,o as g,q as _,t as v,tt as y,v as b,x,y as S}from"./_plugin-vue_export-helper-CQxWhVtr.js";import{i as te}from"./useNodes-W5j_uxdQ.js";import{d as ne,s as re}from"./schema-helpers-1UXlO0Ye.js";import{a as ie,i as ae,n as oe,o as se,r as ce,t as C}from"./CmsImagePreview-DuHPBzml.js";import{n as w,t as le}from"./NodeContextMenu-C_HWBGeb.js";import{n as ue,t as T}from"./trash-2-CAUF1KtI.js";import{t as de}from"./layers-B6RgfpPR.js";import{t as fe}from"./panel-left-close-CVFakVaA.js";import{t as pe}from"./save-Ctv8vW9H.js";import{t as E}from"./CmsButton-CbOfxvjr.js";import{t as D}from"./CmsDataRow--H4iI_u_.js";import{t as O}from"./CmsBadge-D0Ob9qPU.js";m(),h(),u(),g();var me={class:`asset-editor-wrapper canvas`},he={class:`entity-header`},k={class:`top-row`},A={class:`node-info`},j={class:`dynamic-title-group`},M={class:`inline-title-input`},N={key:0},P={key:1},F={class:`meta-row`},I={key:0,class:`slug-badge`},L={class:`actions-group`},R={class:`btn-text`},ge={class:`editor-body`},_e={key:0,class:`loading-state`},ve={key:1,class:`asset-content-scroll`},ye={class:`main-preview-section`},be={key:1,class:`doc-preview`},xe={class:`preview-footer`},Se=[`href`],Ce={class:`data-column`},we={class:`data-header`},Te={class:`data-content`},Ee={class:`form-group`},De={class:`form-group`},Oe={class:`form-group`},ke={class:`usage-and-crops-section`},Ae={class:`usage-section-container`},je={class:`gallery-header-row`},Me={key:0,class:`usage-empty standalone-empty`},Ne={key:1,class:`list-container`},Pe={class:`node-title`},Fe={class:`meta-stack`},Ie={class:`node-field`},Le={key:0,class:`crop-showcase`},Re={class:`crop-name`},ze={key:0,class:`usage-section-container`,style:{"margin-top":`40px`}},Be={class:`gallery-header-row`},Ve={class:`list-container`},He={class:`meta-stack`},Ue={class:`node-field`},We={key:0,class:`crop-showcase`},Ge={class:`crop-item`},Ke={class:`crop-name`},qe=[`onClick`],z=v(o({__name:`AssetEditor`,props:{assetId:{}},setup(o){let u=o,{activeView:m,nodeSchemas:h}=re(),{confirmDiscard:g}=ne(),{navigateToNodeById:v}=te(),z=e(null),B=e(!0),V=e(!1),H=e({filename:``,title:``,alt:``}),U=e({filename:``,title:``,alt:``}),W=e(!1),G=e(null),K=e(null),Je=()=>{if(W.value){W.value=!1;return}G.value&&(K.value=G.value.getBoundingClientRect()),W.value=!0},Ye=b(()=>{let e=[{key:`copy-url`,label:`Copy Public URL`,icon:se},{key:`open-tab`,label:`Open in New Tab`,icon:w}];return z.value&&z.value.connectedNodes?.length>0&&(e.push({key:`div-nodes`,label:``,divider:!0}),e.push({key:`show-nodes`,label:`Connected Nodes (${z.value.connectedNodes.length})`,icon:oe})),e.push({key:`div-1`,label:``,divider:!0},{key:`delete`,label:`Delete Asset`,icon:T}),e}),Xe=async e=>{W.value=!1,z.value&&(e===`copy-url`&&z.value.url?await navigator.clipboard.writeText(z.value.url):e===`open-tab`&&z.value.url?window.open(z.value.url,`_blank`):e===`delete`?await g(`Are you sure you want to delete "${z.value.filename||`this asset`}"?`,`Delete Asset?`,`Delete`,`Cancel`)&&await Ze():e===`show-nodes`&&Y())},Ze=async()=>{try{(await fetch(`/api/admin/assets/${u.assetId}`,{method:`DELETE`})).ok&&(window.dispatchEvent(new CustomEvent(`cms-assets-updated`)),m.value={type:`dashboard`})}catch{}},Qe=b(()=>H.value.filename!==U.value.filename||H.value.title!==U.value.title||H.value.alt!==U.value.alt),q=async()=>{B.value=!0;try{let e=await fetch(`/api/admin/assets/${u.assetId}/details`);if(e.ok){let t=await e.json();z.value=t;let n={filename:t.filename||``,title:t.title||``,alt:t.alt||``};H.value={...n},U.value={...n}}}catch{}finally{B.value=!1}},$e=async()=>{V.value=!0;try{(await fetch(`/api/admin/assets/${u.assetId}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(H.value)})).ok&&(U.value={...H.value},window.dispatchEvent(new CustomEvent(`cms-assets-updated`)))}catch{}finally{V.value=!1}},J=async e=>{let t=`Permanently delete orphaned crop "${z.value?.variants?.find(t=>String(t.id)===String(e))?.filename||`variant`}"?`;if(await g(t,`Delete Crop`,`Delete`,`Cancel`))try{(await fetch(`/api/admin/assets/purge/${e}`,{method:`DELETE`})).ok&&(z.value?.variants&&(z.value.variants=z.value.variants.filter(t=>String(t.id)!==String(e))),window.dispatchEvent(new CustomEvent(`cms-assets-updated`)),await q())}catch{}},et=async()=>{let e=$.value;if(e.length===0)return;let t=`Are you sure you want to permanently delete all ${e.length} orphaned crops?`;if(await g(t,`Purge All Orphaned Crops`,`Purge All`,`Cancel`))try{for(let t of e)await fetch(`/api/admin/assets/purge/${t.id}`,{method:`DELETE`});window.dispatchEvent(new CustomEvent(`cms-assets-updated`)),await q()}catch(e){console.error(`Failed to purge crops`,e)}},tt=e=>{m.value={type:`node`},v(String(e)),window.dispatchEvent(new CustomEvent(`cms-switch-sidebar-tab`,{detail:`vault`}))},Y=()=>{sessionStorage.setItem(`cms-vault-asset-filter`,u.assetId),window.dispatchEvent(new CustomEvent(`cms-filter-vault-by-asset`,{detail:u.assetId})),window.dispatchEvent(new CustomEvent(`cms-switch-sidebar-tab`,{detail:`vault`}))},X=b(()=>z.value&&(z.value.mimeType?.startsWith(`image/`)||/\.(jpg|jpeg|png|webp|gif|svg)$/i.test(z.value.filename))),Z=e=>{if(!e)return`0 B`;let t=1024,n=[`B`,`KB`,`MB`,`GB`],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/t**r).toFixed(1))+` `+n[r]},nt=(e,t)=>{if(!t||t===`Original`||t===`Unknown Crop`)return t||`Original Image`;try{let n=h.value[e];if(!n)return t;let r=null,i=e=>{if(!(!e||r))for(let n of Object.values(e))n.crop&&t===`standard`&&n.crop.label&&(r=n.crop.label),n.crops&&n.crops[t]&&n.crops[t].label&&(r=n.crops[t].label)};return i(n.fields),n.tabs&&Object.values(n.tabs).forEach(e=>i(e.fields)),r||t}catch{return t}},Q=b(()=>{if(!z.value||!z.value.connectedNodes)return[];let e=new Map;for(let t of z.value.connectedNodes){let n=String(t.id),r=t.contentType||t.nodeType,i=t.fieldKey?.split(`.`)[0]||`Content Area`,a=t.fieldKey?.match(/^blocks\[(\d+)\]/);a&&(i=`Block ${parseInt(a[1],10)+1}`);let o=String(t.assetId)!==String(z.value.id),s=null;if(o){let e=z.value.variants?.find(e=>String(e.id)===String(t.assetId));if(e){let n=`Unknown Crop`,i=t.fieldKey?.match(/\.variants\.([^.]+)/);if(i)n=i[1];else{let t=e.filename?.match(/^(.+?)_ast_/);t&&(n=t[1])}s={id:e.id,url:e.url,label:nt(r,n)}}}else s={id:z.value.id,url:z.value.url,label:`Original Image`};if(!e.has(n))e.set(n,{id:t.id,title:t.title,nodeType:r,fieldKeys:new Set([i]),usedAssets:s?[s]:[]});else{let t=e.get(n);t.fieldKeys.add(i),s&&!t.usedAssets.some(e=>e.id===s.id)&&t.usedAssets.push(s)}}return Array.from(e.values()).map(e=>({...e,fieldKey:Array.from(e.fieldKeys).join(`, `)}))}),$=b(()=>{if(!z.value||!z.value.variants)return[];let e=new Set(z.value.connectedNodes?.map(e=>String(e.assetId))||[]);return z.value.variants.filter(t=>!e.has(String(t.id)))}),rt=e=>{let t=e?.match(/^(.+?)_ast_/);return t?t[1]:`Unknown Crop`};return i(()=>q()),(e,i)=>(s(),c(`div`,me,[S(`header`,he,[S(`div`,k,[S(`div`,A,[S(`div`,j,[S(`span`,M,[z.value?(s(),c(`span`,N,r(z.value.filename),1)):(s(),c(`span`,P,`Loading Asset...`))])]),S(`div`,F,[z.value?(s(),c(`span`,I,r(Z(z.value.sizeBytes))+` • `+r(z.value.mimeType),1)):x(``,!0)])]),S(`div`,L,[z.value?(s(),c(`div`,{key:0,class:`context-wrapper`,ref_key:`contextTriggerRef`,ref:G},[n(E,{variant:`secondary`,title:`More Options`,onClick:Je,disabled:V.value,class:`transparent-btn icon-only-btn`},{default:a(()=>[n(y(ae),{size:16})]),_:1},8,[`disabled`]),n(le,{show:W.value,items:Ye.value,"anchor-rect":K.value,onSelect:Xe,onClose:i[0]||=e=>W.value=!1},null,8,[`show`,`items`,`anchor-rect`])],512)):x(``,!0),n(E,{variant:`primary`,class:`save-btn`,disabled:V.value||!Qe.value,onClick:$e},{default:a(()=>[n(y(pe),{size:14,class:`save-icon`}),S(`span`,R,r(V.value?`Saving...`:`Save Metadata`),1)]),_:1},8,[`disabled`])])])]),S(`div`,ge,[B.value?(s(),c(`div`,_e,`Loading asset details...`)):z.value?(s(),c(`div`,ve,[S(`div`,ye,[S(`div`,{class:ee([`preview-container`,{"is-doc":!X.value}])},[X.value?(s(),d(C,{key:0,url:z.value.url,alt:z.value.alt||z.value.filename,width:1200,quality:85,class:`main-preview-wrapper`},null,8,[`url`,`alt`])):(s(),c(`div`,be,[n(y(ue),{size:64}),i[4]||=S(`span`,null,`Preview not available for this file type`,-1)]))],2),S(`div`,xe,[S(`span`,null,`Original Upload: `+r(new Date(z.value.createdAt).toLocaleString()),1),S(`a`,{href:z.value.url,target:`_blank`,class:`ext-link`},[i[5]||=l(`Open original file `,-1),n(y(w),{size:12})],8,Se)])]),S(`div`,Ce,[S(`div`,we,[S(`h3`,null,[n(y(ce),{size:14,class:`inline-icon`}),i[6]||=l(` Metadata `,-1)])]),S(`div`,Te,[S(`div`,Ee,[i[7]||=S(`label`,null,`Filename`,-1),_(S(`input`,{"onUpdate:modelValue":i[1]||=e=>H.value.filename=e,type:`text`,class:`cms-input`},null,512),[[f,H.value.filename]]),i[8]||=S(`span`,{class:`help-text`},`Changing this does not break the permanent CDN link.`,-1)]),S(`div`,De,[i[9]||=S(`label`,null,`Title (Internal/SEO)`,-1),_(S(`input`,{"onUpdate:modelValue":i[2]||=e=>H.value.title=e,type:`text`,class:`cms-input`},null,512),[[f,H.value.title]])]),S(`div`,Oe,[i[10]||=S(`label`,null,`Alt Text (Accessibility)`,-1),_(S(`textarea`,{"onUpdate:modelValue":i[3]||=e=>H.value.alt=e,class:`cms-input cms-textarea`},null,512),[[f,H.value.alt]])])])]),S(`div`,ke,[S(`div`,Ae,[S(`div`,je,[S(`h3`,null,[n(y(de),{size:16,class:`inline-icon`}),i[11]||=l(` Node Usage `,-1)]),Q.value.length>0?(s(),c(`button`,{key:0,class:`action-btn outline`,onClick:Y,title:`Show these nodes in the left Vault pane`},[n(y(fe),{size:13}),i[12]||=l(` Vault Filter `,-1)])):x(``,!0)]),Q.value.length===0?(s(),c(`div`,Me,[...i[13]||=[S(`span`,{class:`status-dot warning`},null,-1),S(`span`,null,`Asset is not currently used on any nodes.`,-1)]])):(s(),c(`div`,Ne,[(s(!0),c(p,null,t(Q.value,e=>(s(),d(D,{key:e.id,clickable:``,onClick:t=>tt(e.id)},{title:a(()=>[i[14]||=S(`span`,{class:`status-dot success`},null,-1),S(`span`,Pe,r(e.title||`Untitled`),1),n(O,{variant:`type`},{default:a(()=>[l(r(e.nodeType||`page`),1)]),_:2},1024)]),meta:a(()=>[S(`div`,Fe,[S(`span`,Ie,`Used in field: `+r(e.fieldKey),1),X.value?(s(),c(`div`,Le,[(s(!0),c(p,null,t(e.usedAssets,e=>(s(),c(`div`,{key:e.id,class:`crop-item`},[n(C,{url:e.url,alt:e.label,width:200,quality:75,class:`crop-img-fixed-height`},null,8,[`url`,`alt`]),S(`span`,Re,r(e.label),1)]))),128))])):x(``,!0)])]),_:2},1032,[`onClick`]))),128))]))]),$.value.length>0?(s(),c(`div`,ze,[S(`div`,Be,[S(`h3`,null,[n(y(ie),{size:16,class:`inline-icon`}),l(` Orphaned Crops (`+r($.value.length)+`) `,1)]),S(`button`,{class:`action-btn outline text-danger`,onClick:et},[n(y(T),{size:13}),i[15]||=l(` Purge All `,-1)])]),i[18]||=S(`p`,{class:`gallery-desc`},`These crops were generated previously but are no longer attached to any nodes. You can safely delete them to save storage space.`,-1),S(`div`,Ve,[(s(!0),c(p,null,t($.value,e=>(s(),d(D,{key:e.id},{title:a(()=>[i[16]||=S(`span`,{class:`node-title`},`Orphaned Crop`,-1),n(O,{variant:`type`},{default:a(()=>[l(r(Z(e.sizeBytes)),1)]),_:2},1024)]),meta:a(()=>[S(`div`,He,[S(`span`,Ue,`Generated: `+r(new Date(e.createdAt).toLocaleDateString()),1),X.value?(s(),c(`div`,We,[S(`div`,Ge,[n(C,{url:e.url,alt:e.filename,width:200,quality:75,class:`crop-img-fixed-height`},null,8,[`url`,`alt`]),S(`span`,Ke,r(rt(e.filename)),1)])])):x(``,!0)])]),actions:a(()=>[S(`button`,{class:`action-btn outline text-danger`,style:{border:`none`},onClick:t=>J(e.id)},[n(y(T),{size:13}),i[17]||=l(` Purge `,-1)],8,qe)]),_:2},1024))),128))])])):x(``,!0)])])):x(``,!0)])]))}}),[[`__scopeId`,`data-v-cd1f3a28`]]);export{z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cms-badge[data-v-a1e8e7f0]{border-radius:var(--cms-radius-xs);white-space:nowrap;font-size:11px;font-weight:500;line-height:1.2;font-family:var(--cms-font-sans);border:1px solid #0000;flex-shrink:0;align-items:center;gap:4px;padding:2px 7px;display:inline-flex}.variant-default[data-v-a1e8e7f0]{background:var(--cms-color-surface-hover);color:var(--cms-color-text-muted);border-color:var(--cms-color-border)}.variant-type[data-v-a1e8e7f0]{text-transform:uppercase;color:var(--cms-color-text-faint);background:var(--cms-color-bg);border-color:var(--cms-color-border);font-size:9.5px;font-weight:700}.variant-slug[data-v-a1e8e7f0]{font-family:var(--cms-font-mono);color:var(--cms-color-text-muted);background:0 0;border:none;padding:0;font-size:12px;font-weight:400}.variant-channel[data-v-a1e8e7f0]{color:#2563eb;background:#3b82f614;border-color:#3b82f633}.variant-tree[data-v-a1e8e7f0]{color:#059669;background:#10b98114;border-color:#10b98133}.variant-node[data-v-a1e8e7f0]{color:#7c3aed;background:#8b5cf614;border-color:#8b5cf633}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as e,R as t,S as n,St as r,V as i,j as a,lt as o,t as s}from"./_plugin-vue_export-helper-CQxWhVtr.js";a(),o();var c=s(e({__name:`CmsBadge`,props:{variant:{}},setup(e){return(a,o)=>(t(),n(`span`,{class:r([`cms-badge`,[`variant-${e.variant||`default`}`]])},[i(a.$slots,`default`,{},void 0,!0)],2))}}),[[`__scopeId`,`data-v-a1e8e7f0`]]);export{c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cms-btn[data-v-371ae993]{font-family:var(--cms-font-sans);border-radius:var(--cms-radius-sm);cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;transition:all var(--cms-transition-fast);border:1px solid #0000;outline:none;justify-content:center;align-items:center;gap:6px;font-weight:550;display:inline-flex}.cms-btn[data-v-371ae993]:active:not(:disabled){transform:scale(.97)}.cms-btn[data-v-371ae993]:disabled{opacity:.55;cursor:not-allowed;box-shadow:none;transform:none!important}.btn-sm[data-v-371ae993]{height:28px;padding:0 10px;font-size:11px}.btn-md[data-v-371ae993]{height:32px;padding:0 14px;font-size:12px}.btn-primary[data-v-371ae993]{background-color:var(--cms-color-primary);color:#fff;border-color:#0000001a}.btn-primary[data-v-371ae993]:hover:not(:disabled){background-color:var(--cms-color-primary-hover)}.btn-secondary[data-v-371ae993]{background-color:var(--cms-color-surface);color:var(--cms-color-text-main);border-color:var(--cms-color-border-dark)}.btn-secondary[data-v-371ae993]:hover:not(:disabled){background-color:var(--cms-color-surface-hover);border-color:var(--cms-color-border-input);color:var(--cms-color-text-main)}.btn-ghost[data-v-371ae993]{color:var(--cms-color-text-muted);box-shadow:none;background-color:#0000;border-color:#0000}.btn-ghost[data-v-371ae993]:hover:not(:disabled){background-color:var(--cms-color-surface-hover);color:var(--cms-color-text-main)}.btn-danger[data-v-371ae993]{background-color:var(--cms-color-danger-light);color:var(--cms-color-danger);border-color:var(--cms-color-danger-border)}.btn-danger[data-v-371ae993]:hover:not(:disabled){background-color:var(--cms-color-danger);color:#fff;border-color:var(--cms-color-danger-hover)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as e,R as t,S as n,St as r,V as i,j as a,lt as o,t as s}from"./_plugin-vue_export-helper-CQxWhVtr.js";a(),o();var c=[`disabled`],l=s(e({__name:`CmsButton`,props:{variant:{},size:{},disabled:{type:Boolean}},setup(e){return(a,o)=>(t(),n(`button`,{class:r([`cms-btn`,`btn-${e.variant||`primary`}`,e.size===`sm`?`btn-sm`:`btn-md`]),disabled:e.disabled},[i(a.$slots,`default`,{},void 0,!0)],10,c))}}),[[`__scopeId`,`data-v-371ae993`]]);export{l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as e,R as t,S as n,St as r,V as i,h as a,j as o,lt as s,o as c,t as l,x as u,y as d}from"./_plugin-vue_export-helper-CQxWhVtr.js";o(),c(),s();var f={class:`row-main`},p={key:0,class:`row-title-group`},m={key:1,class:`row-meta-group`},h=l(e({__name:`CmsDataRow`,props:{isSelected:{type:Boolean},clickable:{type:Boolean}},setup(e){return(o,s)=>(t(),n(`div`,{class:r([`cms-data-row`,{"is-selected":e.isSelected,"is-clickable":e.clickable}]),onClick:s[2]||=e=>o.$emit(`click`)},[o.$slots.prefix?(t(),n(`div`,{key:0,class:`row-prefix`,onClick:s[0]||=a(()=>{},[`stop`])},[i(o.$slots,`prefix`,{},void 0,!0)])):u(``,!0),d(`div`,f,[o.$slots.title?(t(),n(`div`,p,[i(o.$slots,`title`,{},void 0,!0)])):u(``,!0),o.$slots.meta?(t(),n(`div`,m,[i(o.$slots,`meta`,{},void 0,!0)])):u(``,!0)]),o.$slots.actions?(t(),n(`div`,{key:1,class:`row-actions`,onClick:s[1]||=a(()=>{},[`stop`])},[i(o.$slots,`actions`,{},void 0,!0)])):u(``,!0)],2))}}),[[`__scopeId`,`data-v-dba1b464`]]);export{h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cms-data-row[data-v-dba1b464]{border-bottom:1px solid var(--cms-color-border-dark);background:var(--cms-color-surface);transition:background-color var(--cms-transition-fast);align-items:center;gap:16px;padding:12px 16px;display:flex}.cms-data-row.is-clickable[data-v-dba1b464]{cursor:pointer}.cms-data-row[data-v-dba1b464]:last-child{border-bottom:none}.cms-data-row.is-clickable[data-v-dba1b464]:hover{background:var(--cms-color-surface-hover)}.cms-data-row.is-selected[data-v-dba1b464]{background:var(--cms-color-primary-light,#f0fdf4)}.row-prefix[data-v-dba1b464]{flex-shrink:0;align-items:center;display:flex}.row-main[data-v-dba1b464]{flex-direction:column;flex:1;gap:6px;min-width:0;display:flex}.row-title-group[data-v-dba1b464],.row-meta-group[data-v-dba1b464]{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.row-actions[data-v-dba1b464]{flex-shrink:0;justify-content:flex-end;align-items:center;gap:12px;display:flex}@media (width<=768px){.cms-data-row[data-v-dba1b464]{align-items:flex-start;padding:16px}.row-actions[data-v-dba1b464]{flex-direction:row;justify-content:flex-start;align-self:flex-start;margin-top:4px}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e,O as t,R as n,S as r,T as i,Y as a,j as o,t as s,tt as c,y as l}from"./_plugin-vue_export-helper-CQxWhVtr.js";import{a as u,i as d}from"./useNodes-W5j_uxdQ.js";import{n as f,r as p,t as m}from"./plus-mqZr4I1D.js";import{t as h}from"./database-hg5SqKLG.js";import{t as g}from"./folder-tree-BWYot72H.js";import{t as _}from"./globe-BraoljaN.js";import{t as v}from"./layers-B6RgfpPR.js";o(),a();var y={class:`help-canvas`},b={class:`help-container`},x={class:`steps-grid`},S={class:`step-card`},C={class:`card-header`},w={class:`card-icon channel-icon`},T={class:`step-card`},E={class:`card-header`},D={class:`card-icon tree-icon`},O={class:`step-card`},k={class:`card-header`},A={class:`card-icon vault-icon`},j={class:`architecture-guide`},M={class:`guide-header`},N={class:`guide-columns`},P={class:`guide-col-arrow`},F={class:`guide-col-arrow`},I={class:`guide-col-arrow`},L=s(t({__name:`CmsHelp`,setup(t){let{handleAddNewChannel:a}=p(),{handleAddNewTree:o}=u(),{handleAddNewNode:s}=d();return(t,u)=>(n(),r(`main`,y,[l(`div`,b,[u[17]||=l(`header`,{class:`help-header`},[l(`h1`,null,`KAMA`),l(`p`,null,`Build modular content in the Vault, organize it into Navigation Trees, and expose it to your channels via API.`)],-1),l(`div`,x,[l(`div`,S,[l(`div`,C,[l(`div`,w,[e(c(_),{size:20})]),u[3]||=l(`div`,{class:`step-badge`},`Step 1`,-1)]),u[5]||=l(`div`,{class:`card-content`},[l(`h3`,null,`Channels`),l(`p`,null,`Delivery targets that consume your headless API.`)],-1),l(`button`,{class:`card-action-btn`,onClick:u[0]||=(...e)=>c(a)&&c(a)(...e)},[e(c(m),{size:16}),u[4]||=i(` Create Channel `,-1)])]),l(`div`,T,[l(`div`,E,[l(`div`,D,[e(c(g),{size:20})]),u[6]||=l(`div`,{class:`step-badge`},`Step 2`,-1)]),u[8]||=l(`div`,{class:`card-content`},[l(`h3`,null,`Trees`),l(`p`,null,`Decoupled structural hierarchies and navigation menus.`)],-1),l(`button`,{class:`card-action-btn`,onClick:u[1]||=(...e)=>c(o)&&c(o)(...e)},[e(c(m),{size:16}),u[7]||=i(` Create Tree `,-1)])]),l(`div`,O,[l(`div`,k,[l(`div`,A,[e(c(h),{size:20})]),u[9]||=l(`div`,{class:`step-badge`},`Step 3`,-1)]),u[11]||=l(`div`,{class:`card-content`},[l(`h3`,null,`Vault`),l(`p`,null,`Flat, headless content store for reusable content items.`)],-1),l(`button`,{class:`card-action-btn`,onClick:u[2]||=e=>c(s)()},[e(c(m),{size:16}),u[10]||=i(` Create Content `,-1)])])]),l(`section`,j,[l(`div`,M,[e(c(v),{size:18,class:`guide-icon`}),u[12]||=l(`h4`,null,`Architecture Flow`,-1)]),l(`div`,N,[u[13]||=l(`div`,{class:`guide-col`},[l(`strong`,null,`1. Content Vault`),l(`p`,null,`Raw content entities existing independently of routing.`)],-1),l(`div`,P,[e(c(f),{size:16})]),u[14]||=l(`div`,{class:`guide-col`},[l(`strong`,null,`2. Navigation Trees`),l(`p`,null,`Decoupled structures mapping content items to URL hierarchies.`)],-1),l(`div`,F,[e(c(f),{size:16})]),u[15]||=l(`div`,{class:`guide-col`},[l(`strong`,null,`3. Channels`),l(`p`,null,`Delivery targets binding trees and languages to specific contexts.`)],-1),l(`div`,I,[e(c(f),{size:16})]),u[16]||=l(`div`,{class:`guide-col`},[l(`strong`,null,`4. Headless API`),l(`p`,null,`Endpoints serving structured JSON to your frontends.`)],-1)])])])]))}}),[[`__scopeId`,`data-v-c739c397`]]);export{L as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cms-image-preview[data-v-2d18a75f]{justify-content:center;align-items:center;width:100%;min-width:100%;height:100%;min-height:100%;display:flex;position:relative;overflow:hidden}.preview-img[data-v-2d18a75f]{object-fit:cover;object-position:center;width:100%;height:100%;transition:filter var(--cms-transition-fast) ease;display:block}.preview-img.is-svg[data-v-2d18a75f]{object-fit:contain;width:100%!important;max-width:100%!important;height:auto!important;max-height:100%!important}.preview-img.is-blurring[data-v-2d18a75f]{filter:blur(4px)brightness(.7)grayscale(.3)}.loading-overlay[data-v-2d18a75f]{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);color:var(--cms-color-primary);z-index:15;background:#ffffffbf;flex-direction:column;justify-content:center;align-items:center;gap:8px;font-size:12px;font-weight:600;display:flex;position:absolute;inset:0}.spinner[data-v-2d18a75f]{animation:1s linear infinite spin-2d18a75f}@keyframes spin-2d18a75f{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,E as t,O as n,R as r,S as i,St as a,W as o,Y as s,j as c,lt as l,n as u,t as d,tt as f,v as p,x as m}from"./_plugin-vue_export-helper-CQxWhVtr.js";import{t as h}from"./loader-circle-BoUkhDjq.js";var g=u(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),_=u(`crop`,[[`path`,{d:`M6 2v14a2 2 0 0 0 2 2h14`,key:`ron5a4`}],[`path`,{d:`M18 22V8a2 2 0 0 0-2-2H2`,key:`7s9ehn`}]]),v=u(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),y=u(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),b=u(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]);function x(e,t){if(!e)return``;if(!e.includes(`/media/`))return e;try{let n=new URL(e,window.location.origin);return n.pathname.toLowerCase().endsWith(`.svg`)?n.pathname+n.search:(t.w&&n.searchParams.set(`w`,String(t.w)),t.h&&n.searchParams.set(`h`,String(t.h)),n.searchParams.set(`q`,String(t.q||75)),n.searchParams.set(`f`,String(t.f||`auto`)),n.pathname+n.search)}catch{return e}}c(),l(),s();var S={class:`cms-image-preview`},C=[`src`,`alt`],w={key:1,class:`loading-overlay`},T=d(n({__name:`CmsImagePreview`,props:{url:{},alt:{default:`Image preview`},width:{default:800},quality:{default:85},isProcessing:{type:Boolean,default:!1}},setup(n){let s=n,c=e(!1),l=e(null),u=p(()=>{if(!s.url)return!1;let e=s.url.toLowerCase();return e.endsWith(`.svg`)||e.includes(`image/svg+xml`)||e.includes(`.svg?`)});o(()=>s.url,(e,t)=>{e&&e!==t&&(c.value=!0,l.value=null)});let d=()=>{c.value=!1},g=()=>{if(l.value!==s.url&&_.value!==s.url){l.value=s.url,c.value=!0;return}c.value=!1},_=p(()=>s.url?u.value||l.value===s.url?s.url:x(s.url,{w:s.width,q:s.quality}):``);return(e,o)=>(r(),i(`div`,S,[_.value?(r(),i(`img`,{key:0,src:_.value,alt:n.alt,class:a([`preview-img`,{"is-blurring":n.isProcessing||c.value,"is-svg":u.value}]),onLoad:d,onError:g},null,42,C)):m(``,!0),n.isProcessing||c.value?(r(),i(`div`,w,[t(f(h),{size:16,class:`spinner`})])):m(``,!0)]))}}),[[`__scopeId`,`data-v-2d18a75f`]]);export{_ as a,v as i,b as n,g as o,y as r,T as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,E as t,F as n,O as r,R as i,S as a,St as o,V as s,Y as c,g as l,j as u,lt as d,n as f,t as p,tt as m,x as h,y as ee}from"./_plugin-vue_export-helper-CQxWhVtr.js";import{n as g}from"./send-F-mJeL54.js";var _=f(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),v=f(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),y=f(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),b=f(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),x=f(`bold`,[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]),S=f(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),C=f(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),w=f(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),T=f(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),E=f(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),D=f(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),O=f(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),k=f(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),A=f(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),j=f(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),M=f(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),N=f(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),P=f(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),F=f(`heading-4`,[[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17 10v3a1 1 0 0 0 1 1h3`,key:`tj5zdr`}],[`path`,{d:`M21 10v8`,key:`1kdml4`}],[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}]]),I=f(`italic`,[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]),L=f(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),R=f(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),z=f(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),B=f(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),te=f(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),V=f(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),H=f(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),U=f(`move`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m19 9 3 3-3 3`,key:`1mg7y2`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m5 9-3 3 3 3`,key:`j64kie`}],[`path`,{d:`m9 5 3-3 3 3`,key:`l8vdw6`}]]),W=f(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),G=f(`phone`,[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]),K=f(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),q=f(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),J=f(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Y=f(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),X=f(`strikethrough`,[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]),Z=f(`subscript`,[[`path`,{d:`m4 5 8 8`,key:`1eunvl`}],[`path`,{d:`m12 5-8 8`,key:`1ah0jp`}],[`path`,{d:`M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07`,key:`e8ta8j`}]]),Q=f(`superscript`,[[`path`,{d:`m4 19 8-8`,key:`hr47gm`}],[`path`,{d:`m12 19-8-8`,key:`1dhhmo`}],[`path`,{d:`M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06`,key:`1dfcux`}]]),ne=f(`unfold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m15 5-3-3-3 3`,key:`itvq4r`}]]),re=f(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]);u(),c(),d();var ie={key:0,class:`badges-container`},ae={key:0,class:`overlay-badge badge-disabled`,title:`Page is disabled`},oe=[`title`],$={key:1,class:`overlay-badge badge-unpublished`,title:`Has draft changes`},se=p(r({__name:`NodeStatusBadges`,props:{evaluated:{}},setup(e){return(n,r)=>e.evaluated.isDraft?h(``,!0):(i(),a(`div`,ie,[e.evaluated.isHidden?(i(),a(`div`,ae,[t(m(b),{size:10,"stroke-width":`2.5`})])):(i(),a(l,{key:1},[e.evaluated.isScheduled?(i(),a(`div`,{key:0,class:o([`overlay-badge badge-scheduled`,{"badge-scheduled-upcoming":e.evaluated.isUpcoming,"badge-scheduled-showing":e.evaluated.isShowing,"badge-scheduled-passed":e.evaluated.isPassed}]),title:`Status: ${e.evaluated.badgeLabel}`},[t(m(g),{size:10,"stroke-width":`2.5`})],10,oe)):h(``,!0),e.evaluated.hasUnpublishedChanges||e.evaluated.isUnpublishedDraft?(i(),a(`div`,$,[t(m(W),{size:10,"stroke-width":`2.5`})])):h(``,!0)],64))]))}}),[[`__scopeId`,`data-v-98aca3b0`]]);u(),d();var ce=[`id`],le=p(r({__name:`CmsListItem`,props:{selected:{type:Boolean},draft:{type:Boolean},media:{type:Boolean},variant:{},id:{}},setup(e){return(t,n)=>(i(),a(`div`,{id:e.id,class:o([`cms-list-item`,[e.variant===`media`||e.media?`media-list-item`:e.variant===`vault`?`vault-item`:`tree-item`,{active:e.selected,"is-draft":e.draft}]])},[s(t.$slots,`icon`,{},void 0,!0),s(t.$slots,`default`,{},void 0,!0),s(t.$slots,`actions`,{},void 0,!0)],10,ce))}}),[[`__scopeId`,`data-v-50e9ed05`]]);u(),c(),d();var ue={key:0,class:`bottom-touch-handle`,title:`Drag to resize`},de=p(r({__name:`CmsPaneResizer`,props:{disabled:{type:Boolean,default:!1}},emits:[`drag-start`,`drag-move`,`drag-end`],setup(r,{emit:s}){let c=r,l=s,u=e(!1),d=e(!1),f=e=>{if(!c.disabled){if(u.value=!0,document.body.style.userSelect=`none`,document.body.classList.add(`cms-resizer-active-drag`),e.type===`touchstart`){d.value=!0;let t=e;t.cancelable&&t.preventDefault(),document.addEventListener(`touchmove`,g,{passive:!1}),document.addEventListener(`touchend`,_)}else e.preventDefault(),document.body.style.cursor=`col-resize`,document.addEventListener(`mousemove`,p),document.addEventListener(`mouseup`,_);l(`drag-start`,e)}},p=e=>{u.value&&l(`drag-move`,e.clientX,e)},g=e=>{!u.value||!e.touches[0]||l(`drag-move`,e.touches[0].clientX,e)},_=()=>{u.value&&(u.value=!1,document.body.style.cursor=``,document.body.style.userSelect=``,document.body.classList.remove(`cms-resizer-active-drag`),document.removeEventListener(`mousemove`,p),document.removeEventListener(`mouseup`,_),document.removeEventListener(`touchmove`,g),document.removeEventListener(`touchend`,_),l(`drag-end`))};return n(()=>{_()}),(e,n)=>(i(),a(`div`,{class:o([`cms-pane-resizer`,{"is-dragging":u.value,"is-disabled":r.disabled}]),onMousedown:f,onTouchstart:f},[n[0]||=ee(`div`,{class:`resizer-line`},null,-1),d.value?(i(),a(`div`,ue,[t(m(j),{size:14,class:`grip-icon`})])):h(``,!0)],34))}}),[[`__scopeId`,`data-v-4af20519`]]);export{k as A,y as B,I as C,M as D,N as E,w as F,_ as H,C as I,S as L,D as M,E as N,j as O,T as P,x as R,L as S,P as T,v as V,V as _,ne as a,z as b,X as c,q as d,K as f,H as g,U as h,re as i,O as j,A as k,Y as l,W as m,le as n,Q as o,G as p,se as r,Z as s,de as t,J as u,te as v,F as w,R as x,B as y,b as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.badges-container[data-v-98aca3b0]{flex-direction:row-reverse;align-items:center;gap:2px;display:flex;position:absolute;bottom:-4px;right:-4px}.overlay-badge[data-v-98aca3b0]{background:var(--node-badge-bg,var(--cms-color-bg));transition:all var(--cms-transition-fast);border-radius:50%;justify-content:center;align-items:center;padding:1px;display:flex}.badge-disabled[data-v-98aca3b0]{color:var(--cms-color-danger)}.badge-scheduled[data-v-98aca3b0]{color:var(--cms-color-warning,#d97706)}.badge-scheduled.badge-scheduled-upcoming[data-v-98aca3b0]{color:var(--cms-color-info,#0284c7)}.badge-scheduled.badge-scheduled-showing[data-v-98aca3b0]{color:var(--cms-color-success,#16a34a)}.badge-scheduled.badge-scheduled-passed[data-v-98aca3b0]{color:var(--cms-color-warning,#d97706)}.badge-unpublished[data-v-98aca3b0]{color:var(--cms-color-text-muted,#64748b)}.cms-list-item[data-v-50e9ed05]{box-sizing:border-box}.vault-item[data-v-50e9ed05]{border-radius:var(--cms-radius-sm);border:1px solid var(--cms-color-border);cursor:pointer;-webkit-user-select:none;user-select:none;transition:all var(--cms-transition-fast);--node-badge-bg:var(--cms-color-bg);background:0 0;align-items:flex-start;gap:8px;margin:0 -8px;padding:7px 6px;display:flex}.vault-item[data-v-50e9ed05]:hover:not(.active){border-color:var(--cms-color-border-dark);--node-badge-bg:var(--cms-color-surface-hover);background:var(--cms-color-surface-hover)}.vault-item.active[data-v-50e9ed05]{background:var(--cms-color-primary-light);border-color:var(--cms-color-primary-border);color:var(--cms-color-text-main);box-shadow:var(--cms-shadow-xs);--node-badge-bg:var(--cms-color-primary-light)}@keyframes draft-pulse-50e9ed05{0%{opacity:.5}50%{opacity:.85}to{opacity:.5}}.vault-item.is-draft[data-v-50e9ed05]{border:1px dashed var(--cms-color-border-dark);background:0 0;animation:2s ease-in-out infinite draft-pulse-50e9ed05}.vault-item.is-draft[data-v-50e9ed05] .item-title{color:var(--cms-color-text-muted);font-style:italic}.media-list-item[data-v-50e9ed05]{border-radius:var(--cms-radius-sm);border:1px solid var(--cms-color-border);cursor:grab;transition:all var(--cms-transition-fast);align-items:center;gap:14px;padding:6px;display:flex;position:relative}.media-list-item[data-v-50e9ed05]:active{cursor:grabbing}.media-list-item[data-v-50e9ed05]:hover{border-color:var(--cms-color-border-dark);background:var(--cms-color-surface-hover)}.media-list-item.active[data-v-50e9ed05]{border-color:var(--cms-color-primary);background:var(--cms-color-primary-light)}[data-v-50e9ed05] .thumb-wrapper,[data-v-50e9ed05] .doc-wrapper{border-radius:var(--cms-radius-sm);background:var(--cms-color-surface-hover);pointer-events:none;flex-shrink:0;justify-content:center;align-items:center;width:48px;height:48px;display:flex;overflow:hidden}[data-v-50e9ed05] .thumb-wrapper img{object-fit:cover;width:100%;height:100%}[data-v-50e9ed05] .doc-wrapper{color:var(--cms-color-text-muted)}[data-v-50e9ed05] .file-name{font-family:var(--cms-font-sans);color:var(--cms-color-text-main);white-space:nowrap;text-overflow:ellipsis;font-size:11px;font-weight:600;overflow:hidden}[data-v-50e9ed05] .meta-size{font-family:var(--cms-font-sans);color:var(--cms-color-text-muted);white-space:nowrap;font-size:10px;font-weight:500}[data-v-50e9ed05] .item-actions{opacity:0;transition:opacity var(--cms-transition-fast);align-items:center;gap:4px;display:flex;position:absolute;top:4px;right:4px}.media-list-item[data-v-50e9ed05]:hover .item-actions,[data-v-50e9ed05] .item-actions.menu-open{opacity:1}[data-v-50e9ed05] .more-btn{color:var(--cms-color-text-muted);border-radius:var(--cms-radius-xs);cursor:pointer;transition:all var(--cms-transition-fast);background:0 0;border:none;padding:2px}[data-v-50e9ed05] .more-btn:hover{background:var(--cms-color-border);color:var(--cms-color-text-main)}[data-v-50e9ed05] .icon-wrapper{flex-shrink:0;justify-content:center;align-items:center;width:16px;height:16px;margin-top:2px;display:inline-flex;position:relative}[data-v-50e9ed05] .item-icon{color:var(--cms-color-text-faint);transition:color var(--cms-transition-fast)}.vault-item.active[data-v-50e9ed05] .item-icon{color:var(--cms-color-primary)}[data-v-50e9ed05] .item-details{flex-direction:column;flex:1;min-width:0;display:flex}[data-v-50e9ed05] .type-label{font-family:var(--cms-font-sans);text-transform:capitalize;color:var(--cms-color-text-muted);font-size:9.5px;font-weight:600;line-height:1.2}[data-v-50e9ed05] .item-title{font-family:var(--cms-font-sans);color:var(--cms-color-text-main);white-space:nowrap;text-overflow:ellipsis;font-size:12.5px;font-weight:550;line-height:1.35;overflow:hidden}[data-v-50e9ed05] .meta-row{align-items:center;gap:6px;margin-top:2px;display:flex}[data-v-50e9ed05] .sort-field-tag{font-family:var(--cms-font-sans);color:var(--cms-color-text-muted);white-space:nowrap;text-overflow:ellipsis;font-size:10px;font-weight:500;overflow:hidden}[data-v-50e9ed05] .tree-tag-icon{color:#10b981;justify-content:center;align-items:center;display:inline-flex}[data-v-50e9ed05] .asset-tag-icon,[data-v-50e9ed05] .node-tag-icon{color:var(--cms-color-primary);opacity:.85;align-items:center;gap:2.5px;display:inline-flex}[data-v-50e9ed05] .asset-tag-icon .count-text,[data-v-50e9ed05] .node-tag-icon .count-text{font-size:9.5px;font-weight:700;line-height:1}[data-v-50e9ed05] .node-tag-icon.variant-tag{color:var(--cms-color-text-muted)}[data-v-50e9ed05] .node-actions{opacity:0;transition:opacity var(--cms-transition-fast);align-items:center;display:flex}.vault-item[data-v-50e9ed05]:hover .node-actions,[data-v-50e9ed05] .node-actions.menu-open{opacity:1}[data-v-50e9ed05] .action-btn{border-radius:var(--cms-radius-xs);color:var(--cms-color-text-muted);cursor:pointer;transition:all var(--cms-transition-fast);background:0 0;border:none;justify-content:center;align-items:center;padding:3px;display:flex}[data-v-50e9ed05] .action-btn:hover{background:var(--cms-color-border-dark);color:var(--cms-color-text-main)}.cms-pane-resizer[data-v-4af20519]{z-index:100;cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;flex-shrink:0;justify-content:center;align-items:center;width:12px;height:100%;margin-left:-6px;margin-right:-6px;display:flex;position:relative}.cms-pane-resizer.is-disabled[data-v-4af20519]{pointer-events:none;opacity:0}.resizer-line[data-v-4af20519]{background-color:var(--cms-color-border,#cbd5e1);width:2px;height:100%;transition:background-color var(--cms-transition-fast,.15s ease), width var(--cms-transition-fast,.15s ease)}.cms-pane-resizer:hover .resizer-line[data-v-4af20519],.cms-pane-resizer.is-dragging .resizer-line[data-v-4af20519]{background-color:var(--cms-color-primary,#3b82f6);width:3px}.bottom-touch-handle[data-v-4af20519]{background:var(--cms-color-bg,#fff);border:1px solid var(--cms-color-border,#cbd5e1);border-radius:var(--cms-radius-xs,4px);width:20px;height:32px;color:var(--cms-color-text-muted,#64748b);pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;bottom:16px;left:50%;transform:translate(-50%);box-shadow:0 1px 3px #0000001f}.cms-pane-resizer.is-dragging .bottom-touch-handle[data-v-4af20519]{border-color:var(--cms-color-primary,#3b82f6);color:var(--cms-color-primary,#3b82f6)}.grip-icon[data-v-4af20519]{pointer-events:none}body.cms-resizer-active-drag iframe,body.cms-resizer-active-drag canvas,body.cms-resizer-active-drag .editor-canvas-wrapper{pointer-events:none!important}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{$ as e,B as t,E as n,Et as r,I as i,K as a,O as ee,R as o,S as s,T as c,Y as l,b as u,g as d,h as f,j as p,lt as m,o as h,t as g,tt as _,v,x as y,y as b}from"./_plugin-vue_export-helper-CQxWhVtr.js";import{c as x,i as te}from"./useNodes-W5j_uxdQ.js";import{l as S,s as ne}from"./schema-helpers-1UXlO0Ye.js";import{t as C}from"./circle-check-A-QeFqt3.js";import{n as re,t as w}from"./send-F-mJeL54.js";import{t as ie}from"./folder-tree-BWYot72H.js";import{t as ae}from"./globe-BraoljaN.js";import{t as oe}from"./history-pqIbKK9u.js";import{t as T}from"./loader-circle-BoUkhDjq.js";import{t as E}from"./CmsButton-CbOfxvjr.js";import{t as D}from"./CmsDataRow--H4iI_u_.js";import{t as O}from"./CmsBadge-D0Ob9qPU.js";p(),l(),m(),h();var se={class:`publisher-canvas full-width`},ce={class:`publisher-container full-width`},le={class:`publisher-header`},ue={class:`header-actions`},de={key:0,class:`empty-publisher-state`},fe={key:1,class:`empty-publisher-state`},pe={key:2,class:`channel-groups-list`},k={class:`group-header`},A={class:`group-title`},j=[`checked`,`indeterminate`,`onChange`],M={class:`count-badge`},N={class:`nodes-table`},P=[`checked`,`onChange`],F={class:`node-title`},I={key:3,class:`history-section`},L={class:`history-header`},R={class:`history-card`},z={class:`node-title`},B={class:`history-time`},V=g(ee({__name:`CmsPublisher`,setup(ee){let l=ne(),{loadNodeContent:p}=te(),m=e(!1),h=e(new Set),g=e(null),V=e(!1),H=e([]),U=e([]),W=e(new Set),me=async()=>{if(l.hasLoadedStats.value){H.value=l.vaultStats.value?.pendingNodes||[],U.value=l.vaultStats.value?.recentActivity||[];return}m.value=!0;try{let e=await fetch(`/api/cms/stats`);if(e.ok){let t=await e.json();l.vaultStats.value=t,l.hasLoadedStats.value=!0,H.value=t.pendingNodes||[],U.value=t.recentActivity||[]}}catch{}finally{m.value=!1}},G=v(()=>{let e=new Map;if(H.value.forEach(t=>{let n=String(l.activeNode.value?.id)===String(t.id),r=x(t),i=n&&l.hasUnpublishedChanges.value||r.hasUnpublishedChanges;e.set(String(t.id),{...t,evalState:{...r,hasUnpublishedChanges:i}})}),l.activeNode.value?.id){let t=String(l.activeNode.value.id),n=x(l.activeNode.value),r=l.hasUnpublishedChanges.value||n.hasUnpublishedChanges;(n.isDraft||n.isUnpublishedDraft||r)&&(e.has(t)||e.set(t,{...l.activeNode.value,evalState:{...n,hasUnpublishedChanges:r}}))}return Array.from(e.values())}),he=v(()=>{let e=new Map,t=`Unassigned / Vault Only`;return e.set(t,{channelName:t,nodes:[]}),G.value.forEach(n=>{let r=n.channelNames||[];r.length===0?e.get(t).nodes.push(n):r.forEach(t=>{e.has(t)||e.set(t,{channelName:t,nodes:[]}),e.get(t).nodes.push(n)})}),Array.from(e.values()).filter(e=>e.nodes.length>0)}),K=e=>W.value.has(e),ge=e=>{let t=new Set(W.value);t.has(e)?t.delete(e):t.add(e),W.value=t},q=e=>e.filter(e=>W.value.has(e.id)).length,J=e=>e.length>0&&e.every(e=>W.value.has(e.id)),_e=e=>q(e)>0&&q(e)<e.length,Y=e=>{let t=new Set(W.value),n=J(e);e.forEach(e=>{n?t.delete(e.id):t.add(e.id)}),W.value=t},X=v(()=>W.value.size),Z=e=>{p({id:e.id,title:e.title,slug:e.slug,nodeType:e.contentType||e.nodeType,channelId:e.channelId||``,language:e.language||`en`,children:[]})},Q=e=>{U.value=[{id:e.id,title:e.title||`Untitled Document`,slug:e.slug,contentType:e.contentType||e.nodeType||`page`,updatedAt:new Date().toISOString()},...U.value.filter(t=>String(t.id)!==String(e.id))].slice(0,10)},ve=async e=>{h.value.add(e);try{let t=G.value.find(t=>String(t.id)===String(e));if((await S.publishNode(e)).ok){l.updateNodeInState(e,{status:`published`,hasUnpublishedChanges:!1}),H.value=H.value.filter(t=>String(t.id)!==String(e)),String(l.activeNode.value?.id)===String(e)&&(l.activeNode.value.status=`published`,l.activeNode.value.hasUnpublishedChanges=!1);let n=new Set(W.value);n.delete(e),W.value=n,t&&Q(t),l.invalidateStats(),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`cms-node-updated`))}}finally{h.value.delete(e)}},$=async e=>{if(e.length===0)return;let t=e.map(e=>e.id);t.forEach(e=>h.value.add(e));try{let e=await S.publishNodesBatch(t);if(e.ok){let t=(await e.json()).publishedIds||[];for(let e of t)l.updateNodeInState(e,{status:`published`,hasUnpublishedChanges:!1}),String(l.activeNode.value?.id)===String(e)&&(l.activeNode.value.status=`published`,l.activeNode.value.hasUnpublishedChanges=!1);G.value.filter(e=>t.includes(e.id)).forEach(e=>Q(e)),H.value=H.value.filter(e=>!t.includes(e.id));let n=new Set(W.value);t.forEach(e=>n.delete(e)),W.value=n,l.invalidateStats(),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`cms-node-updated`))}}finally{t.forEach(e=>h.value.delete(e))}},ye=async(e,t)=>{g.value=e;let n=q(t)>0?t.filter(e=>W.value.has(e.id)):t;await $(n),g.value=null},be=async()=>{V.value=!0;let e=X.value>0?G.value.filter(e=>W.value.has(e.id)):G.value;await $(e),V.value=!1},xe=e=>{if(!e)return``;try{return new Date(e).toLocaleString([],{dateStyle:`medium`,timeStyle:`short`})}catch{return e}};return i(()=>me()),(e,i)=>(o(),s(`main`,se,[b(`div`,ce,[b(`header`,le,[i[2]||=b(`div`,{class:`header-title-group`},[b(`h1`,null,`Publishing Center`),b(`p`,null,`Review and release pending drafts or bulk-publish updates across your distribution channels.`)],-1),b(`div`,ue,[G.value.length>0?(o(),u(E,{key:0,variant:`primary`,class:`publish-all-btn`,disabled:V.value||h.value.size>0,onClick:be},{default:a(()=>[V.value?(o(),u(_(T),{key:0,size:16,class:`spin`})):(o(),u(_(w),{key:1,size:16})),b(`span`,null,r(X.value>0?`Publish Selected (${X.value})`:`Publish All
|
|
2
|
+
(${G.value.length})`),1)]),_:1},8,[`disabled`])):y(``,!0)])]),m.value&&G.value.length===0?(o(),s(`div`,de,[n(_(T),{size:28,class:`spin empty-icon`}),i[3]||=b(`p`,null,`Gathering pending content updates...`,-1)])):G.value.length===0?(o(),s(`div`,fe,[n(_(C),{size:36,class:`success-icon`}),i[4]||=b(`h3`,null,`All Content Published!`,-1),i[5]||=b(`p`,null,`No draft changes or pending revisions found. Your delivery channels are fully up to date.`,-1)])):(o(),s(`div`,pe,[(o(!0),s(d,null,t(he.value,e=>(o(),s(`section`,{key:e.channelName,class:`channel-group-card`},[b(`div`,k,[b(`div`,A,[b(`label`,{class:`checkbox-container`,onClick:i[0]||=f(()=>{},[`stop`])},[b(`input`,{type:`checkbox`,checked:J(e.nodes),indeterminate:_e(e.nodes),onChange:t=>Y(e.nodes)},null,40,j),i[6]||=b(`span`,{class:`checkmark`},null,-1)]),n(_(ae),{size:18,class:`channel-icon`}),b(`h2`,null,r(e.channelName),1),b(`span`,M,r(e.nodes.length)+` Pending`,1)]),n(E,{variant:`secondary`,size:`sm`,disabled:g.value===e.channelName||V.value,onClick:t=>ye(e.channelName,e.nodes)},{default:a(()=>[g.value===e.channelName?(o(),u(_(T),{key:0,size:14,class:`spin`})):(o(),u(_(w),{key:1,size:14})),b(`span`,null,r(q(e.nodes)>0?`Publish Selected
|
|
3
|
+
(${q(e.nodes)})`:`Publish Channel Items`),1)]),_:2},1032,[`disabled`,`onClick`])]),b(`div`,N,[(o(!0),s(d,null,t(e.nodes,e=>(o(),u(D,{key:e.id,"is-selected":K(e.id),clickable:``,onClick:t=>Z(e)},{prefix:a(()=>[b(`label`,{class:`checkbox-container`,onClick:i[1]||=f(()=>{},[`stop`])},[b(`input`,{type:`checkbox`,checked:K(e.id),onChange:t=>ge(e.id)},null,40,P),i[7]||=b(`span`,{class:`checkmark`},null,-1)])]),title:a(()=>[b(`span`,F,r(e.title||`Untitled Draft`),1),n(O,{variant:`type`},{default:a(()=>[c(r(e.contentType||e.nodeType||`page`),1)]),_:2},1024)]),meta:a(()=>[n(O,{variant:`slug`},{default:a(()=>[c(`/`+r(e.slug),1)]),_:2},1024),(o(!0),s(d,null,t(e.treeNames,e=>(o(),u(O,{variant:`tree`,key:e},{default:a(()=>[n(_(ie),{size:11}),c(` `+r(e),1)]),_:2},1024))),128))]),actions:a(()=>[n(E,{variant:`secondary`,size:`sm`,class:`icon-only-btn`,title:`Publish Item`,disabled:h.value.has(e.id)||V.value,onClick:f(t=>ve(e.id),[`stop`])},{default:a(()=>[h.value.has(e.id)?(o(),u(_(T),{key:0,size:14,class:`spin`})):(o(),u(_(w),{key:1,size:14}))]),_:2},1032,[`disabled`,`onClick`])]),_:2},1032,[`is-selected`,`onClick`]))),128))])]))),128))])),U.value.length>0?(o(),s(`section`,I,[b(`div`,L,[n(_(oe),{size:18,class:`history-icon`}),i[8]||=b(`h2`,null,`Recently Published`,-1)]),b(`div`,R,[(o(!0),s(d,null,t(U.value,e=>(o(),u(D,{key:e.id,clickable:``,onClick:t=>Z(e)},{prefix:a(()=>[n(_(C),{size:16,class:`published-check`})]),title:a(()=>[b(`span`,z,r(e.title||`Untitled Document`),1),n(O,{variant:`type`},{default:a(()=>[c(r(e.contentType||e.nodeType||`page`),1)]),_:2},1024)]),meta:a(()=>[n(O,{variant:`slug`},{default:a(()=>[c(`/`+r(e.slug),1)]),_:2},1024)]),actions:a(()=>[b(`div`,B,[n(_(re),{size:12}),b(`span`,null,r(xe(e.updatedAt)),1)])]),_:2},1032,[`onClick`]))),128))])])):y(``,!0)])]))}}),[[`__scopeId`,`data-v-e0e64ba6`]]);export{V as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,E as t,Et as n,K as r,O as i,R as a,S as o,T as s,Y as c,d as l,f as u,j as d,l as f,lt as p,o as m,q as h,t as g,tt as _,y as v}from"./_plugin-vue_export-helper-CQxWhVtr.js";import{a as y,i as ee,n as b,o as x,r as S,t as C}from"./user-IFlT6mYq.js";import{t as w}from"./globe-BraoljaN.js";import{t as T}from"./save-Ctv8vW9H.js";import{t as E}from"./smartphone-EPce6VdP.js";import{t as D}from"./CmsButton-CbOfxvjr.js";import{t as O}from"./CmsDataRow--H4iI_u_.js";d(),c(),m(),p();var k={class:`user-center-canvas`},A={class:`user-center-container`},j={class:`settings-grid`},M={class:`settings-column`},N={class:`settings-card`},P={class:`card-header`},F={class:`header-title`},I={class:`card-body dynamic-form`},L={class:`form-row`},R={class:`form-group half-width`},z={class:`form-group half-width`},B={class:`form-group`},V={class:`form-group`},H={class:`form-actions`},U={class:`settings-card`},te={class:`card-header`},W={class:`header-title`},G={class:`card-body`},K={class:`setting-row`},q={class:`setting-info`},J={class:`setting-row`},Y={class:`setting-info`},X={class:`setting-row toggle-row`},Z={class:`setting-info`},Q={class:`toggle-switch`},ne={class:`settings-column`},re={class:`settings-card`},ie={class:`card-header`},ae={class:`header-title`},oe={class:`card-body`},se={class:`security-block`},ce={class:`block-info`},le={class:`security-block`},ue={class:`block-info`},de={class:`settings-card`},fe={class:`card-header`},pe={class:`header-title`},$={class:`card-body p-0`,style:{padding:`0`}},me={class:`session-icon-box current-device`},he={class:`session-icon-box`},ge={class:`logout-btn`,title:`Revoke session`},_e={class:`form-actions`,style:{padding:`16px`}},ve=g(i({__name:`CmsUserCenter`,setup(i){let c=e({firstName:`Admin`,lastName:`User`,email:`admin@kama-cms.com`,role:`Administrator`}),d=e({theme:`system`,language:`en`,emailNotifications:!0}),p=e(!1),m=()=>{p.value=!0,setTimeout(()=>{p.value=!1},600)};return(e,i)=>(a(),o(`main`,k,[v(`div`,A,[i[31]||=v(`header`,{class:`view-header`},[v(`h1`,null,`User Center`),v(`p`,null,`Manage your personal profile, security settings, and global preferences.`)],-1),v(`div`,j,[v(`div`,M,[v(`section`,N,[v(`header`,P,[v(`div`,F,[t(_(C),{size:18,class:`section-icon`}),i[7]||=v(`h2`,null,`Profile Information`,-1)])]),v(`div`,I,[v(`div`,L,[v(`div`,R,[i[8]||=v(`div`,{class:`label-row`},[v(`label`,null,`First Name`)],-1),h(v(`input`,{type:`text`,"onUpdate:modelValue":i[0]||=e=>c.value.firstName=e},null,512),[[u,c.value.firstName]])]),v(`div`,z,[i[9]||=v(`div`,{class:`label-row`},[v(`label`,null,`Last Name`)],-1),h(v(`input`,{type:`text`,"onUpdate:modelValue":i[1]||=e=>c.value.lastName=e},null,512),[[u,c.value.lastName]])])]),v(`div`,B,[i[10]||=v(`div`,{class:`label-row`},[v(`label`,null,`Email Address`)],-1),h(v(`input`,{type:`email`,"onUpdate:modelValue":i[2]||=e=>c.value.email=e},null,512),[[u,c.value.email]])]),v(`div`,V,[i[11]||=v(`div`,{class:`label-row`},[v(`label`,null,`Role / Access Level`)],-1),h(v(`input`,{type:`text`,"onUpdate:modelValue":i[3]||=e=>c.value.role=e,disabled:``,class:`disabled-input`},null,512),[[u,c.value.role]])]),v(`div`,H,[t(D,{variant:`primary`,onClick:m,disabled:p.value},{default:r(()=>[t(_(T),{size:14}),v(`span`,null,n(p.value?`Saving...`:`Save Profile`),1)]),_:1},8,[`disabled`])])])]),v(`section`,U,[v(`header`,te,[v(`div`,W,[t(_(x),{size:18,class:`section-icon`}),i[12]||=v(`h2`,null,`Preferences`,-1)])]),v(`div`,G,[v(`div`,K,[v(`div`,q,[t(_(S),{size:16,class:`setting-icon`}),i[13]||=v(`div`,null,[v(`strong`,null,`Interface Theme`),v(`p`,null,`Choose your preferred color mode.`)],-1)]),h(v(`select`,{class:`cms-select`,"onUpdate:modelValue":i[4]||=e=>d.value.theme=e},[...i[14]||=[v(`option`,{value:`light`},`Light`,-1),v(`option`,{value:`dark`},`Dark`,-1),v(`option`,{value:`system`},`System Default`,-1)]],512),[[l,d.value.theme]])]),v(`div`,J,[v(`div`,Y,[t(_(w),{size:16,class:`setting-icon`}),i[15]||=v(`div`,null,[v(`strong`,null,`Language`),v(`p`,null,`CMS interface language.`)],-1)]),h(v(`select`,{class:`cms-select`,"onUpdate:modelValue":i[5]||=e=>d.value.language=e},[...i[16]||=[v(`option`,{value:`en`},`English (US)`,-1),v(`option`,{value:`de`},`German`,-1),v(`option`,{value:`fr`},`French`,-1)]],512),[[l,d.value.language]])]),v(`div`,X,[v(`div`,Z,[t(_(x),{size:16,class:`setting-icon`}),i[17]||=v(`div`,null,[v(`strong`,null,`Email Notifications`),v(`p`,null,`Receive alerts for workflow changes.`)],-1)]),v(`label`,Q,[h(v(`input`,{type:`checkbox`,"onUpdate:modelValue":i[6]||=e=>d.value.emailNotifications=e},null,512),[[f,d.value.emailNotifications]]),i[18]||=v(`span`,{class:`slider`},null,-1)])])])])]),v(`div`,ne,[v(`section`,re,[v(`header`,ie,[v(`div`,ae,[t(_(b),{size:18,class:`section-icon`}),i[19]||=v(`h2`,null,`Security`,-1)])]),v(`div`,oe,[v(`div`,se,[v(`div`,ce,[t(_(y),{size:16}),i[20]||=v(`div`,null,[v(`strong`,null,`Password`),v(`p`,null,`Last changed 3 months ago.`)],-1)]),t(D,{variant:`secondary`,size:`sm`},{default:r(()=>[...i[21]||=[s(`Update`,-1)]]),_:1})]),v(`div`,le,[v(`div`,ue,[t(_(b),{size:16}),i[22]||=v(`div`,null,[v(`strong`,null,`Two-Factor Authentication`),v(`p`,null,`Add an extra layer of security.`)],-1)]),t(D,{variant:`secondary`,size:`sm`},{default:r(()=>[...i[23]||=[s(`Enable 2FA`,-1)]]),_:1})])])]),v(`section`,de,[v(`header`,fe,[v(`div`,pe,[t(_(E),{size:18,class:`section-icon`}),i[24]||=v(`h2`,null,`Active Sessions`,-1)])]),v(`div`,$,[t(O,{"is-selected":!0,style:{"border-radius":`0`}},{prefix:r(()=>[v(`div`,me,[t(_(w),{size:16})])]),title:r(()=>[...i[25]||=[v(`span`,{style:{"font-weight":`600`}},`Mac OS • Chrome`,-1)]]),meta:r(()=>[...i[26]||=[v(`span`,{style:{"font-size":`11.5px`,color:`var(--cms-color-text-muted)`}},`Current session • IP: 192.168.1.1`,-1)]]),actions:r(()=>[...i[27]||=[v(`span`,{class:`active-badge`},`Active Now`,-1)]]),_:1}),t(O,null,{prefix:r(()=>[v(`div`,he,[t(_(E),{size:16})])]),title:r(()=>[...i[28]||=[v(`span`,{style:{"font-weight":`600`}},`iOS • Safari`,-1)]]),meta:r(()=>[...i[29]||=[v(`span`,{style:{"font-size":`11.5px`,color:`var(--cms-color-text-muted)`}},`Last seen 2 hours ago • IP: 10.0.0.45`,-1)]]),actions:r(()=>[v(`button`,ge,[t(_(ee),{size:14})])]),_:1}),v(`div`,_e,[t(D,{variant:`danger-outline`,class:`full-width-btn`},{default:r(()=>[...i[30]||=[s(`Log out of all other devices `,-1)]]),_:1})])])])])])])]))}}),[[`__scopeId`,`data-v-8dc2f1d9`]]);export{ve as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,Ct as t,E as n,Et as r,F as i,I as a,K as o,O as s,P as ee,R as c,S as l,St as u,T as d,U as f,W as p,Y as m,b as h,g as te,j as g,lt as _,t as v,tt as y,v as b,x,y as S}from"./_plugin-vue_export-helper-CQxWhVtr.js";import{s as C,t as ne}from"./schema-helpers-1UXlO0Ye.js";import{i as re,n as ie,r as ae,t as w}from"./useLocalStorage-C805uplI.js";import{n as oe,t as se}from"./NodeContextMenu-C_HWBGeb.js";import{i as ce,n as le,r as ue,t as de}from"./monitor-CrpvInqG.js";import{t as fe}from"./history-pqIbKK9u.js";import{t as pe}from"./smartphone-EPce6VdP.js";import{t as me}from"./StatusPill-CbeW5SMT.js";g(),m(),_();var he={class:`split-preview-pane`},ge={class:`preview-toolbar`},_e={class:`segmented-control`},ve={class:`device-controls-group`},ye=[`title`],be={class:`trigger-label`},xe=[`title`],Se={class:`toolbar-right`},Ce=[`href`],we=[`href`],Te=[`src`,`title`],T=v(s({__name:`EditorSplitPreview`,props:{paneWidthPx:{}},emits:[`close`],setup(s,{emit:m}){let g=s,_=m,{activeNode:v,selectedChannelId:T,selectedLanguage:E,allChannels:D,activeSnapshotVersion:O,nodeSchemas:Ee}=C(),k=e(null),A=e(null),j=w(`kama_preview_mode`,`draft`),M=w(`kama_preview_device`,`desktop`),N=w(`kama_preview_orientation`,`portrait`),P=w(`kama_preview_autofit`,!0),F=e({w:800,h:800}),I=e(Date.now()),L=e(``),R=async()=>{let e=v.value?.id;if(!e)return;let t=D.value.find(e=>String(e.id)===String(T.value)),n=!1;if(t)try{let r=t.channelRoot;!r&&t.dataJson&&(r=(typeof t.dataJson==`string`?JSON.parse(t.dataJson):t.dataJson)?.channelRoot),typeof r==`string`&&(r=JSON.parse(r));let i=r?.nodeId??r?.id;i&&String(i)===String(e)&&(n=!0)}catch{}if(n){L.value=`/`;return}try{let n=t?.id||T.value||``,r=await fetch(`/api/cms/nodes.json?id=${e}&channelId=${n}`);if(r.ok){let e=await r.json();if(e.node?.path){L.value=e.node.path;return}}}catch(e){console.error(`Failed to fetch live canonical route`,e)}let r=v.value?.slug||``;L.value=r===`index`?`/`:`/${r.replace(/^\/+|\/+$/g,``)}`};p(()=>v.value?.id,R,{immediate:!0});let z={desktop:{label:`Desktop (100% Fluid)`,width:null,height:null},desktop_4k:{label:`4K UHD (3840 × 2160)`,width:3840,height:2160},desktop_fhd:{label:`Full HD (1920 × 1080)`,width:1920,height:1080},macbook_air:{label:`MacBook Air (1440 × 900)`,width:1440,height:900},laptop_std:{label:`Laptop (1366 × 768)`,width:1366,height:768},ipad_pro:{label:`iPad Pro 12.9" (1024 × 1366)`,width:1024,height:1366},ipad_air:{label:`iPad Air / Mini (820 × 1180)`,width:820,height:1180},ipad_standard:{label:`iPad 10th Gen (810 × 1080)`,width:810,height:1080},iphone_15_pro_max:{label:`iPhone 15 Pro Max (430 × 932)`,width:430,height:932},iphone_15_pro:{label:`iPhone 15 Pro (393 × 852)`,width:393,height:852},iphone_se:{label:`iPhone SE (375 × 667)`,width:375,height:667},samsung_s23:{label:`Samsung Galaxy S23 (360 × 780)`,width:360,height:780}},B=b(()=>{let e=0;return Object.values(z).forEach(t=>{t.label.length>e&&(e=t.label.length)}),`${Math.ceil(e*7.2)+48}px`}),V=e(!1),H=e(null),U=e(null),De=b(()=>Object.entries(z).map(([e,t])=>({key:e,label:t.label,title:t.label,isActive:M.value===e}))),Oe=()=>{if(V.value){V.value=!1;return}H.value&&(U.value=H.value.getBoundingClientRect()),V.value=!0},ke=e=>{M.value=String(e),V.value=!1,X()},Ae=b(()=>z[M.value]?.label||`Select Device`),je=b(()=>{if(!v.value)return`Untitled`;let e=Ee.value?.[v.value.nodeType||``];return ne(e,v.value)}),W=b(()=>{let e=D.value.find(e=>String(e.id)===String(T.value)),t=e?.baseUrl||e?.url||(typeof window<`u`?window.location.origin:``);if((t.includes(`localhost:8787`)||t.includes(`127.0.0.1:8787`))&&(t=t.replace(`8787`,`4321`)),t=t.replace(/\/$/,``),!v.value?.id)return t;let n=L.value;n.startsWith(`/`)||(n=`/${n}`);let r=n===`/`?``:n,i=E.value?`/${E.value}`:``,a=`${t}${i}${r}`,o=`_cb=${I.value}`;return O.value?`${a}?preview=true&revisionId=${O.value}&${o}`:`${a}?${j.value===`draft`?`preview=true&`:``}${o}`}),Me=b(()=>{if(!v.value)return`#`;let e=L.value;e.startsWith(`/`)||(e=`/${e}`);let t=e===`/`?``:e,n=E.value?`&lang=${E.value}`:``,r=O.value?`&revisionId=${O.value}`:``,i=j.value===`draft`||!!O.value;return`/api/v1/node${t}?channelId=${T.value}&preview=${i}${n}${r}`}),G=b(()=>M.value!==`desktop`),K=b(()=>{let e=z[M.value];if(!e||!e.width||!e.height)return{w:null,h:null};let t=N.value===`landscape`;return{w:t?e.height:e.width,h:t?e.width:e.height}}),q=b(()=>{let{w:e,h:t}=K.value;return!e||!t||e>t?`landscape`:`portrait`}),J=b(()=>{if(!G.value||!P.value)return 1;let{w:e,h:t}=K.value;if(!e||!t)return 1;let n=Math.max(100,F.value.w-48),r=Math.max(100,F.value.h-48),i=n/e,a=r/t;return Math.max(.15,Math.min(i,a))}),Y=()=>{if(A.value){let e=A.value.clientWidth,t=A.value.clientHeight;if(e>0&&t>0)F.value={w:e,h:t};else{let e=A.value.getBoundingClientRect();e.width>0&&e.height>0&&(F.value={w:e.width,h:e.height})}}},X=()=>{ee(()=>{requestAnimationFrame(()=>{Y()})})},Z=()=>{N.value=N.value===`portrait`?`landscape`:`portrait`,X()},Ne=()=>{P.value=!P.value,X()},Pe=()=>{I.value=Date.now()},Fe=()=>{X()},Q=async()=>{let e=W.value;await R(),e===W.value&&k.value?.contentWindow&&k.value.contentWindow.postMessage({type:`kama-preview-update`,url:W.value},`*`)};p(O,e=>{e&&(j.value=`draft`)}),p(()=>g.paneWidthPx,()=>{Y()});let $=null;return a(()=>{typeof window<`u`&&window.addEventListener(`cms-node-updated`,Q),A.value&&(Y(),$=new ResizeObserver(()=>Y()),$.observe(A.value)),X()}),i(()=>{typeof window<`u`&&window.removeEventListener(`cms-node-updated`,Q),$&&$.disconnect()}),(e,i)=>(c(),l(`div`,he,[S(`header`,ge,[S(`div`,_e,[y(O)?(c(),h(me,{key:0,variant:`warning`,icon:y(fe),title:`Viewing Historical Snapshot`},{default:o(()=>[d(` v`+r(y(O)),1)]),_:1},8,[`icon`])):(c(),l(te,{key:1},[S(`button`,{type:`button`,class:u([`segmented-btn text-btn`,{active:y(j)===`draft`}]),onClick:i[0]||=e=>j.value=`draft`},` Draft `,2),S(`button`,{type:`button`,class:u([`segmented-btn text-btn`,{active:y(j)===`live`}]),onClick:i[1]||=e=>j.value=`live`},` Public `,2)],64))]),S(`div`,ve,[G.value?(c(),l(`button`,{key:0,type:`button`,class:u([`icon-btn zoom-btn`,{active:y(P)}]),title:y(P)?`Auto-Fit Active (Click for 1:1 Real Size)`:`1:1 Real Size Active (Click to Auto-Fit)`,onClick:Ne},[(c(),h(f(y(P)?y(le):y(ue)),{size:14}))],10,ye)):x(``,!0),S(`div`,{class:`device-menu-wrapper`,ref_key:`deviceTriggerRef`,ref:H,style:t({width:B.value})},[S(`button`,{type:`button`,class:`device-trigger-btn`,onClick:Oe},[n(y(de),{size:13,class:`trigger-icon`}),S(`span`,be,r(Ae.value),1),n(y(re),{size:12,class:`chevron-icon`})]),n(se,{show:V.value,items:De.value,"anchor-rect":U.value,"min-width":B.value,onSelect:ke,onClose:i[2]||=e=>V.value=!1},null,8,[`show`,`items`,`anchor-rect`,`min-width`])],4),G.value?(c(),l(`button`,{key:1,type:`button`,class:`icon-btn orientation-btn`,title:`Switch to ${q.value===`portrait`?`Landscape`:`Portrait`}`,onClick:Z},[n(y(pe),{size:14,style:t({transform:q.value===`landscape`?`rotate(90deg)`:`rotate(0deg)`,transition:`transform 0.2s`})},null,8,[`style`])],8,xe)):x(``,!0)]),S(`div`,Se,[S(`button`,{type:`button`,class:`icon-btn`,title:`Refresh Preview`,onClick:Pe},[n(y(ae),{size:13})]),S(`a`,{href:Me.value,target:`_blank`,class:`icon-btn`,title:`View JSON API Payload`},[n(y(ce),{size:13})],8,Ce),S(`a`,{href:W.value,target:`_blank`,class:`icon-btn`,title:`Open Preview in New Tab`},[n(y(oe),{size:13})],8,we),S(`button`,{type:`button`,class:`icon-btn close-btn`,title:`Close Split View`,onClick:i[3]||=e=>_(`close`)},[n(y(ie),{size:14})])])]),S(`div`,{ref_key:`stageRef`,ref:A,class:u([`preview-stage`,{"is-fixed-frame":G.value}])},[S(`div`,{class:`device-frame-wrapper`,style:t(G.value&&K.value.w&&K.value.h?{width:`${K.value.w*J.value}px`,height:`${K.value.h*J.value}px`}:{width:`100%`,height:`100%`})},[S(`div`,{class:`device-frame`,style:t(G.value&&K.value.w&&K.value.h?{width:`${K.value.w}px`,height:`${K.value.h}px`,transform:`scale(${J.value})`,transformOrigin:`top left`}:{width:`100%`,height:`100%`})},[(c(),l(`iframe`,{key:W.value,ref_key:`previewIframeRef`,ref:k,src:W.value,class:`preview-iframe`,title:je.value,onLoad:Fe},null,40,Te))],4)],4)],2)]))}}),[[`__scopeId`,`data-v-f9dd6bd0`]]);export{T as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.node-context-menu{z-index:99999;box-sizing:border-box;-webkit-backdrop-filter:blur(18px)saturate(180%);backdrop-filter:blur(18px)saturate(180%);font-family:var(--cms-font-sans);background:#ffffffad;border:1px solid #fff9;border-radius:10px;flex-direction:column;padding:6px;animation:.15s cubic-bezier(.2,.8,.2,1) forwards contextMenuPop;display:flex;position:fixed;transform:translateZ(0);box-shadow:0 8px 32px #1f268714,inset 0 0 0 1px #fff3}@keyframes contextMenuPop{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.node-context-menu .menu-item-wrapper{border-radius:6px;justify-content:space-between;align-items:center;transition:all .15s;display:flex}.node-context-menu .menu-item-wrapper:hover{background:#0000000f}.node-context-menu .menu-item-wrapper:active{background:#0000001a;transform:scale(.98)}.node-context-menu .menu-item{text-align:left;color:var(--cms-color-text-main,#1e293b);cursor:pointer;background:0 0;border:none;flex:1;align-items:center;gap:10px;padding:7px 10px;font-size:13px;font-weight:500;display:flex}.node-context-menu .menu-icon{opacity:.6;transition:opacity .15s}.node-context-menu .menu-item-wrapper:hover .menu-item{color:#000}.node-context-menu .menu-item-wrapper:hover .menu-icon{opacity:1}.node-context-menu .action-btn{cursor:pointer;color:var(--cms-color-text-faint,#64748b);background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;margin-right:4px;padding:6px;transition:all .1s ease-out;display:flex}.node-context-menu .action-btn:hover{color:var(--cms-color-text-main,#000);background:#00000014}.node-context-menu .menu-item-wrapper.is-active .menu-item{color:var(--cms-color-primary,#3b82f6)}.node-context-menu .menu-divider{background:#00000014;height:1px;margin:6px 4px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,B as t,Ct as n,Et as r,L as i,O as a,P as o,R as s,S as c,St as l,U as u,W as d,Y as f,_ as p,b as m,g as h,h as g,j as _,lt as v,n as y,o as b,v as x,x as S,y as C}from"./_plugin-vue_export-helper-CQxWhVtr.js";var w=y(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]);_(),v(),b(),f();var T={key:0,class:`menu-divider`},E=[`onClick`],D=[`title`,`onClick`],O=a({__name:`NodeContextMenu`,props:{show:{type:Boolean},items:{},x:{},y:{},anchorRect:{},minWidth:{}},emits:[`select`,`action`,`close`],setup(a,{emit:f}){let _=a,v=f,y=e(null),b=e({top:0,left:0,transformOrigin:`top left`});d(()=>[_.show,_.x,_.y,_.anchorRect],async()=>{if(!_.show)return;await o();let e=y.value,t=e?e.offsetWidth:190,n=e?e.offsetHeight:150,r=window.innerWidth,i=window.innerHeight,a=0,s=0,c,l=`top`,u=`left`;if(_.anchorRect){let e=_.anchorRect;c=`${e.width}px`,s=e.left,s+t>r-8&&(s=Math.max(8,e.right-t),u=`right`),e.bottom+6+n>i-8?(a=e.top-n-6,l=`bottom`):(a=e.bottom+6,l=`top`)}else s=_.x||0,a=_.y||0,s+t>r-8&&(s=Math.max(8,s-t),u=`right`),a+n>i-8&&(a=Math.max(8,a-n),l=`bottom`);b.value={top:Math.max(8,a),left:Math.max(8,s),width:c,transformOrigin:`${l} ${u}`}},{immediate:!0});let w=x(()=>({top:`${b.value.top}px`,left:`${b.value.left}px`,width:b.value.width||`auto`,minWidth:_.minWidth||`190px`,transformOrigin:b.value.transformOrigin})),O=e=>{if(!_.show)return;let t=e.target;if(!(y.value&&y.value.contains(t))){if(_.anchorRect){let{left:t,right:n,top:r,bottom:i}=_.anchorRect;if(e.clientX>=t&&e.clientX<=n&&e.clientY>=r&&e.clientY<=i)return}v(`close`)}};return d(()=>_.show,e=>{e?setTimeout(()=>{document.addEventListener(`click`,O,!1)},0):document.removeEventListener(`click`,O,!1)},{immediate:!0}),i(()=>{document.removeEventListener(`click`,O,!1)}),(e,i)=>(s(),m(p,{to:`body`},[a.show?(s(),c(`div`,{key:0,ref_key:`menuRef`,ref:y,class:`node-context-menu`,style:n(w.value),onClick:i[0]||=g(()=>{},[`stop`])},[(s(!0),c(h,null,t(a.items,(e,t)=>(s(),c(h,{key:e.key||t},[e.divider?(s(),c(`div`,T)):(s(),c(`div`,{key:1,class:l([`menu-item-wrapper`,{"is-active":e.isActive}])},[C(`button`,{class:`menu-item`,onClick:t=>v(`select`,e.key)},[e.icon?(s(),m(u(e.icon),{key:0,size:15,class:`menu-icon`})):S(``,!0),C(`span`,null,r(e.label),1)],8,E),e.hasAction?(s(),c(`button`,{key:0,class:`action-btn`,title:e.actionTitle,onClick:g(t=>v(`action`,e.key),[`stop`])},[(s(),m(u(e.actionIcon),{size:14}))],8,D)):S(``,!0)],2))],64))),128))],4)):S(``,!0)]))}});export{w as n,O as t};
|