mechanica 2.0.0-alpha.3 → 2.0.0-alpha.4
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/mechanica.js +0 -0
- package/dist/chunks/{create-mechanica-CM_DrG9j.js → create-mechanica-CnBFiyfJ.js} +1 -1
- package/dist/chunks/{editor-pyN0-GS5.js → editor-BYMvxQTM.js} +1 -1
- package/dist/chunks/{preview-Bxlqu_RP.js → preview-G5_AFI5P.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/composer.js +9 -5
- package/dist/editor.css +140 -140
- package/dist/editor.js +7 -5
- package/dist/index.js +2 -2
- package/package.json +2 -2
package/bin/mechanica.js
CHANGED
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as renderBlocks, t as createMechanica } from "./create-mechanica-
|
|
1
|
+
import { i as renderBlocks, t as createMechanica } from "./create-mechanica-CnBFiyfJ.js";
|
|
2
2
|
import { createApp, defineComponent, h } from "vue";
|
|
3
3
|
import { areFieldSchemasRegistered, buildPreviewData, registerFieldSchemas } from "mechanica-shared";
|
|
4
4
|
import { unfoldSchema } from "compact-json-schema";
|
package/dist/cli.js
CHANGED
|
@@ -363,7 +363,7 @@ async function exportProject(cwd, ssr, options = {}) {
|
|
|
363
363
|
force: true
|
|
364
364
|
});
|
|
365
365
|
await mkdir(exportDir, { recursive: true });
|
|
366
|
-
const DIST_PRIVATE = new Set([
|
|
366
|
+
const DIST_PRIVATE = /* @__PURE__ */ new Set([
|
|
367
367
|
"index.html",
|
|
368
368
|
"ssr.js",
|
|
369
369
|
"ssr.js.map",
|
package/dist/composer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './editor.css';
|
|
2
|
-
import { c as ANCHOR_H, i as renderBlocks, l as ANCHOR_V, t as createMechanica } from "./chunks/create-mechanica-
|
|
3
|
-
import { C as registerBuiltinFieldEditors, N as VSelect_default, P as VPopover_default, S as uid, _ as findParentSlot, a as FieldControl_default, b as relocateBlock, d as humanize, f as cloneBlock, g as findParentList, h as findBlock, i as SchemaField_default, m as ensureSlotList, n as createSaveQueue, o as shortcutChar, p as duplicateBlock, t as SaveConflictError, u as toBlockMeta, v as moveBlock, x as removeBlock, y as placeBlock } from "./chunks/editor-
|
|
2
|
+
import { c as ANCHOR_H, i as renderBlocks, l as ANCHOR_V, t as createMechanica } from "./chunks/create-mechanica-CnBFiyfJ.js";
|
|
3
|
+
import { C as registerBuiltinFieldEditors, N as VSelect_default, P as VPopover_default, S as uid, _ as findParentSlot, a as FieldControl_default, b as relocateBlock, d as humanize, f as cloneBlock, g as findParentList, h as findBlock, i as SchemaField_default, m as ensureSlotList, n as createSaveQueue, o as shortcutChar, p as duplicateBlock, t as SaveConflictError, u as toBlockMeta, v as moveBlock, x as removeBlock, y as placeBlock } from "./chunks/editor-BYMvxQTM.js";
|
|
4
4
|
import { d as contents, l as _plugin_vue_export_helper_default, u as VIcon_default } from "./chunks/ImagePickerDialog-BfjNtRoR.js";
|
|
5
5
|
import { Fragment, Teleport, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, openBlock, provide, reactive, ref, renderList, renderSlot, resolveComponent, toDisplayString, unref, vModelText, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
6
6
|
import { buildPreviewData, getDefaultValue, isBinding, registerFieldSchemas, resolveBindings, walkTree } from "mechanica-shared";
|
|
@@ -2031,7 +2031,8 @@ var CanvasOverlay_default = /* @__PURE__ */ defineComponent({
|
|
|
2031
2031
|
};
|
|
2032
2032
|
gapRaf = requestAnimationFrame(loop);
|
|
2033
2033
|
const onMove = (e) => {
|
|
2034
|
-
const
|
|
2034
|
+
const pos = axis === "x" ? e.clientX : e.clientY;
|
|
2035
|
+
const raw = startGap + (pos - startPos) / store.zoom;
|
|
2035
2036
|
const gap = Math.max(0, e.shiftKey ? snapTo(raw, SNAP) : Math.round(raw));
|
|
2036
2037
|
store.setData(id, { gap }, { responsive: true });
|
|
2037
2038
|
};
|
|
@@ -2065,7 +2066,9 @@ var CanvasOverlay_default = /* @__PURE__ */ defineComponent({
|
|
|
2065
2066
|
const onKey = (e) => padAlt.value = e.altKey;
|
|
2066
2067
|
const onMove = (e) => {
|
|
2067
2068
|
padAlt.value = e.altKey;
|
|
2068
|
-
const
|
|
2069
|
+
const pos = axis === "x" ? e.clientX : e.clientY;
|
|
2070
|
+
const delta = sign * (pos - startPos) / store.zoom;
|
|
2071
|
+
const sides = computePaddingDrag(startSides, side, delta, {
|
|
2069
2072
|
symmetric: e.altKey,
|
|
2070
2073
|
snap: e.shiftKey ? SNAP : 0
|
|
2071
2074
|
});
|
|
@@ -2417,7 +2420,8 @@ var ComposerCanvas_default = /* @__PURE__ */ defineComponent({
|
|
|
2417
2420
|
hoverId.value = null;
|
|
2418
2421
|
return;
|
|
2419
2422
|
}
|
|
2420
|
-
|
|
2423
|
+
const el = document.elementFromPoint(event.clientX, event.clientY)?.closest("[data-block-id]");
|
|
2424
|
+
hoverId.value = el?.getAttribute("data-block-id") ?? null;
|
|
2421
2425
|
}
|
|
2422
2426
|
function onCanvasDblClick(event) {
|
|
2423
2427
|
const el = event.target.closest("[data-block-id]");
|
package/dist/editor.css
CHANGED
|
@@ -1,143 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
width: 1em;
|
|
3
|
-
height: 1em;
|
|
4
|
-
flex: none;
|
|
5
|
-
}.mech-modal[data-v-04d89005] {
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
max-height: 84vh;
|
|
9
|
-
width: 100%;
|
|
10
|
-
background: var(--mech-bg);
|
|
11
|
-
border-radius: 18px;
|
|
12
|
-
box-shadow: var(--mech-shadow-dialog);
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
}
|
|
15
|
-
.mech-modal--standard[data-v-04d89005] {
|
|
16
|
-
max-width: 560px;
|
|
17
|
-
}
|
|
18
|
-
.mech-modal--wide[data-v-04d89005] {
|
|
19
|
-
max-width: 880px;
|
|
20
|
-
}
|
|
21
|
-
.mech-modal__header[data-v-04d89005] {
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
gap: 8px;
|
|
25
|
-
padding: 18px 14px 12px 24px;
|
|
26
|
-
flex: none;
|
|
27
|
-
}
|
|
28
|
-
.mech-modal__title[data-v-04d89005] {
|
|
29
|
-
margin: 0;
|
|
30
|
-
font-size: 16px;
|
|
31
|
-
font-weight: 600;
|
|
32
|
-
letter-spacing: -0.01em;
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
text-overflow: ellipsis;
|
|
35
|
-
white-space: nowrap;
|
|
36
|
-
}
|
|
37
|
-
.mech-modal__close[data-v-04d89005] {
|
|
38
|
-
display: flex;
|
|
39
|
-
align-items: center;
|
|
40
|
-
justify-content: center;
|
|
41
|
-
margin-left: auto;
|
|
42
|
-
width: 34px;
|
|
43
|
-
height: 34px;
|
|
44
|
-
border: none;
|
|
45
|
-
background: none;
|
|
46
|
-
color: var(--mech-muted);
|
|
47
|
-
border-radius: var(--mech-radius-pill);
|
|
48
|
-
cursor: pointer;
|
|
49
|
-
}
|
|
50
|
-
.mech-modal__close .vicon[data-v-04d89005] {
|
|
51
|
-
width: 18px;
|
|
52
|
-
height: 18px;
|
|
53
|
-
}
|
|
54
|
-
.mech-modal__close[data-v-04d89005]:hover {
|
|
55
|
-
background: var(--mech-hover);
|
|
56
|
-
color: var(--mech-fg);
|
|
57
|
-
}
|
|
58
|
-
.mech-modal__body[data-v-04d89005] {
|
|
59
|
-
padding: 4px 24px 24px;
|
|
60
|
-
overflow-y: auto;
|
|
61
|
-
}
|
|
62
|
-
.mech-modal__actions[data-v-04d89005] {
|
|
63
|
-
display: flex;
|
|
64
|
-
justify-content: flex-end;
|
|
65
|
-
align-items: center;
|
|
66
|
-
gap: 8px;
|
|
67
|
-
padding: 12px 24px 18px;
|
|
68
|
-
flex: none;
|
|
69
|
-
}.mech-image-picker[data-v-4ef9dd0d] {
|
|
70
|
-
display: flex;
|
|
71
|
-
flex-direction: column;
|
|
72
|
-
gap: 16px;
|
|
73
|
-
min-height: 36vh;
|
|
74
|
-
}
|
|
75
|
-
.mech-image-picker__upload[data-v-4ef9dd0d] {
|
|
76
|
-
display: flex;
|
|
77
|
-
flex-direction: column;
|
|
78
|
-
align-items: center;
|
|
79
|
-
justify-content: center;
|
|
80
|
-
gap: 8px;
|
|
81
|
-
padding: 26px 16px;
|
|
82
|
-
border: 1px dashed var(--mech-input-border);
|
|
83
|
-
border-radius: var(--mech-radius);
|
|
84
|
-
color: var(--mech-muted);
|
|
85
|
-
font-size: 13px;
|
|
86
|
-
cursor: pointer;
|
|
87
|
-
transition: border-color 0.12s, background 0.12s, color 0.12s;
|
|
88
|
-
}
|
|
89
|
-
.mech-image-picker__upload[data-v-4ef9dd0d]:hover, .mech-image-picker__upload.is-dragover[data-v-4ef9dd0d] {
|
|
90
|
-
border-color: var(--mech-accent);
|
|
91
|
-
background: var(--mech-accent-soft);
|
|
92
|
-
color: var(--mech-fg);
|
|
93
|
-
}
|
|
94
|
-
.mech-image-picker__file[data-v-4ef9dd0d] {
|
|
95
|
-
display: none;
|
|
96
|
-
}
|
|
97
|
-
.mech-image-picker__upload-glyph[data-v-4ef9dd0d] {
|
|
98
|
-
width: 26px;
|
|
99
|
-
height: 26px;
|
|
100
|
-
opacity: 0.7;
|
|
101
|
-
}
|
|
102
|
-
.mech-image-picker__lib-head[data-v-4ef9dd0d] {
|
|
103
|
-
font-size: 11px;
|
|
104
|
-
font-weight: 600;
|
|
105
|
-
text-transform: uppercase;
|
|
106
|
-
letter-spacing: 0.05em;
|
|
107
|
-
color: var(--mech-muted);
|
|
108
|
-
}
|
|
109
|
-
.mech-image-picker__grid[data-v-4ef9dd0d] {
|
|
110
|
-
display: grid;
|
|
111
|
-
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
|
|
112
|
-
gap: 10px;
|
|
113
|
-
}
|
|
114
|
-
.mech-image-picker__item[data-v-4ef9dd0d] {
|
|
115
|
-
display: block;
|
|
116
|
-
padding: 0;
|
|
117
|
-
border: 1px solid var(--mech-border);
|
|
118
|
-
border-radius: var(--mech-radius-sm);
|
|
119
|
-
background: var(--mech-active);
|
|
120
|
-
cursor: pointer;
|
|
121
|
-
overflow: hidden;
|
|
122
|
-
aspect-ratio: 1;
|
|
123
|
-
transition: border-color 0.12s, box-shadow 0.12s;
|
|
124
|
-
}
|
|
125
|
-
.mech-image-picker__item img[data-v-4ef9dd0d] {
|
|
126
|
-
display: block;
|
|
127
|
-
width: 100%;
|
|
128
|
-
height: 100%;
|
|
129
|
-
object-fit: cover;
|
|
130
|
-
}
|
|
131
|
-
.mech-image-picker__item[data-v-4ef9dd0d]:hover {
|
|
132
|
-
border-color: var(--mech-accent);
|
|
133
|
-
box-shadow: 0 0 0 2px var(--mech-ring);
|
|
134
|
-
}
|
|
135
|
-
.mech-image-picker__empty[data-v-4ef9dd0d] {
|
|
136
|
-
margin: 0;
|
|
137
|
-
padding: 8px 0;
|
|
138
|
-
color: var(--mech-muted);
|
|
139
|
-
font-size: 13px;
|
|
140
|
-
}@property --el-dir {
|
|
1
|
+
@property --el-dir {
|
|
141
2
|
syntax: "*";
|
|
142
3
|
inherits: false;
|
|
143
4
|
}
|
|
@@ -467,6 +328,145 @@
|
|
|
467
328
|
background: rgba(0, 0, 0, 0.04);
|
|
468
329
|
border: 1px dashed rgba(0, 0, 0, 0.16);
|
|
469
330
|
border-radius: var(--el-radius, 8px);
|
|
331
|
+
}.vicon {
|
|
332
|
+
width: 1em;
|
|
333
|
+
height: 1em;
|
|
334
|
+
flex: none;
|
|
335
|
+
}.mech-modal[data-v-04d89005] {
|
|
336
|
+
display: flex;
|
|
337
|
+
flex-direction: column;
|
|
338
|
+
max-height: 84vh;
|
|
339
|
+
width: 100%;
|
|
340
|
+
background: var(--mech-bg);
|
|
341
|
+
border-radius: 18px;
|
|
342
|
+
box-shadow: var(--mech-shadow-dialog);
|
|
343
|
+
overflow: hidden;
|
|
344
|
+
}
|
|
345
|
+
.mech-modal--standard[data-v-04d89005] {
|
|
346
|
+
max-width: 560px;
|
|
347
|
+
}
|
|
348
|
+
.mech-modal--wide[data-v-04d89005] {
|
|
349
|
+
max-width: 880px;
|
|
350
|
+
}
|
|
351
|
+
.mech-modal__header[data-v-04d89005] {
|
|
352
|
+
display: flex;
|
|
353
|
+
align-items: center;
|
|
354
|
+
gap: 8px;
|
|
355
|
+
padding: 18px 14px 12px 24px;
|
|
356
|
+
flex: none;
|
|
357
|
+
}
|
|
358
|
+
.mech-modal__title[data-v-04d89005] {
|
|
359
|
+
margin: 0;
|
|
360
|
+
font-size: 16px;
|
|
361
|
+
font-weight: 600;
|
|
362
|
+
letter-spacing: -0.01em;
|
|
363
|
+
overflow: hidden;
|
|
364
|
+
text-overflow: ellipsis;
|
|
365
|
+
white-space: nowrap;
|
|
366
|
+
}
|
|
367
|
+
.mech-modal__close[data-v-04d89005] {
|
|
368
|
+
display: flex;
|
|
369
|
+
align-items: center;
|
|
370
|
+
justify-content: center;
|
|
371
|
+
margin-left: auto;
|
|
372
|
+
width: 34px;
|
|
373
|
+
height: 34px;
|
|
374
|
+
border: none;
|
|
375
|
+
background: none;
|
|
376
|
+
color: var(--mech-muted);
|
|
377
|
+
border-radius: var(--mech-radius-pill);
|
|
378
|
+
cursor: pointer;
|
|
379
|
+
}
|
|
380
|
+
.mech-modal__close .vicon[data-v-04d89005] {
|
|
381
|
+
width: 18px;
|
|
382
|
+
height: 18px;
|
|
383
|
+
}
|
|
384
|
+
.mech-modal__close[data-v-04d89005]:hover {
|
|
385
|
+
background: var(--mech-hover);
|
|
386
|
+
color: var(--mech-fg);
|
|
387
|
+
}
|
|
388
|
+
.mech-modal__body[data-v-04d89005] {
|
|
389
|
+
padding: 4px 24px 24px;
|
|
390
|
+
overflow-y: auto;
|
|
391
|
+
}
|
|
392
|
+
.mech-modal__actions[data-v-04d89005] {
|
|
393
|
+
display: flex;
|
|
394
|
+
justify-content: flex-end;
|
|
395
|
+
align-items: center;
|
|
396
|
+
gap: 8px;
|
|
397
|
+
padding: 12px 24px 18px;
|
|
398
|
+
flex: none;
|
|
399
|
+
}.mech-image-picker[data-v-4ef9dd0d] {
|
|
400
|
+
display: flex;
|
|
401
|
+
flex-direction: column;
|
|
402
|
+
gap: 16px;
|
|
403
|
+
min-height: 36vh;
|
|
404
|
+
}
|
|
405
|
+
.mech-image-picker__upload[data-v-4ef9dd0d] {
|
|
406
|
+
display: flex;
|
|
407
|
+
flex-direction: column;
|
|
408
|
+
align-items: center;
|
|
409
|
+
justify-content: center;
|
|
410
|
+
gap: 8px;
|
|
411
|
+
padding: 26px 16px;
|
|
412
|
+
border: 1px dashed var(--mech-input-border);
|
|
413
|
+
border-radius: var(--mech-radius);
|
|
414
|
+
color: var(--mech-muted);
|
|
415
|
+
font-size: 13px;
|
|
416
|
+
cursor: pointer;
|
|
417
|
+
transition: border-color 0.12s, background 0.12s, color 0.12s;
|
|
418
|
+
}
|
|
419
|
+
.mech-image-picker__upload[data-v-4ef9dd0d]:hover, .mech-image-picker__upload.is-dragover[data-v-4ef9dd0d] {
|
|
420
|
+
border-color: var(--mech-accent);
|
|
421
|
+
background: var(--mech-accent-soft);
|
|
422
|
+
color: var(--mech-fg);
|
|
423
|
+
}
|
|
424
|
+
.mech-image-picker__file[data-v-4ef9dd0d] {
|
|
425
|
+
display: none;
|
|
426
|
+
}
|
|
427
|
+
.mech-image-picker__upload-glyph[data-v-4ef9dd0d] {
|
|
428
|
+
width: 26px;
|
|
429
|
+
height: 26px;
|
|
430
|
+
opacity: 0.7;
|
|
431
|
+
}
|
|
432
|
+
.mech-image-picker__lib-head[data-v-4ef9dd0d] {
|
|
433
|
+
font-size: 11px;
|
|
434
|
+
font-weight: 600;
|
|
435
|
+
text-transform: uppercase;
|
|
436
|
+
letter-spacing: 0.05em;
|
|
437
|
+
color: var(--mech-muted);
|
|
438
|
+
}
|
|
439
|
+
.mech-image-picker__grid[data-v-4ef9dd0d] {
|
|
440
|
+
display: grid;
|
|
441
|
+
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
|
|
442
|
+
gap: 10px;
|
|
443
|
+
}
|
|
444
|
+
.mech-image-picker__item[data-v-4ef9dd0d] {
|
|
445
|
+
display: block;
|
|
446
|
+
padding: 0;
|
|
447
|
+
border: 1px solid var(--mech-border);
|
|
448
|
+
border-radius: var(--mech-radius-sm);
|
|
449
|
+
background: var(--mech-active);
|
|
450
|
+
cursor: pointer;
|
|
451
|
+
overflow: hidden;
|
|
452
|
+
aspect-ratio: 1;
|
|
453
|
+
transition: border-color 0.12s, box-shadow 0.12s;
|
|
454
|
+
}
|
|
455
|
+
.mech-image-picker__item img[data-v-4ef9dd0d] {
|
|
456
|
+
display: block;
|
|
457
|
+
width: 100%;
|
|
458
|
+
height: 100%;
|
|
459
|
+
object-fit: cover;
|
|
460
|
+
}
|
|
461
|
+
.mech-image-picker__item[data-v-4ef9dd0d]:hover {
|
|
462
|
+
border-color: var(--mech-accent);
|
|
463
|
+
box-shadow: 0 0 0 2px var(--mech-ring);
|
|
464
|
+
}
|
|
465
|
+
.mech-image-picker__empty[data-v-4ef9dd0d] {
|
|
466
|
+
margin: 0;
|
|
467
|
+
padding: 8px 0;
|
|
468
|
+
color: var(--mech-muted);
|
|
469
|
+
font-size: 13px;
|
|
470
470
|
}.mech-popover[data-v-4884cec4] {
|
|
471
471
|
position: fixed;
|
|
472
472
|
z-index: 2147483680;
|
package/dist/editor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './editor.css';
|
|
2
|
-
import { f as createRouter, h as mechanicaKey, i as renderBlocks, n as pushStateUpdate, r as createComposedComponent, s as registerElements } from "./chunks/create-mechanica-
|
|
3
|
-
import { i as getDataEntries, t as buildPreviewContent } from "./chunks/preview-
|
|
4
|
-
import { A as groupPagesByFolder, C as registerBuiltinFieldEditors, D as VSegmented_default, E as createContextMenu, M as pathFromName, O as fetchPages, P as VPopover_default, T as contextMenuKey, _ as findParentSlot, b as relocateBlock, c as compareBlocks, f as cloneBlock, h as findBlock, j as pageThumbUrl, k as filterPages, l as createContentBlock, n as createSaveQueue, o as shortcutChar, p as duplicateBlock, r as SchemaForm_default, s as blockAvailableIn, t as SaveConflictError, u as toBlockMeta, v as moveBlock, w as registerRichTextWidgets, x as removeBlock, y as placeBlock } from "./chunks/editor-
|
|
2
|
+
import { f as createRouter, h as mechanicaKey, i as renderBlocks, n as pushStateUpdate, r as createComposedComponent, s as registerElements } from "./chunks/create-mechanica-CnBFiyfJ.js";
|
|
3
|
+
import { i as getDataEntries, t as buildPreviewContent } from "./chunks/preview-G5_AFI5P.js";
|
|
4
|
+
import { A as groupPagesByFolder, C as registerBuiltinFieldEditors, D as VSegmented_default, E as createContextMenu, M as pathFromName, O as fetchPages, P as VPopover_default, T as contextMenuKey, _ as findParentSlot, b as relocateBlock, c as compareBlocks, f as cloneBlock, h as findBlock, j as pageThumbUrl, k as filterPages, l as createContentBlock, n as createSaveQueue, o as shortcutChar, p as duplicateBlock, r as SchemaForm_default, s as blockAvailableIn, t as SaveConflictError, u as toBlockMeta, v as moveBlock, w as registerRichTextWidgets, x as removeBlock, y as placeBlock } from "./chunks/editor-BYMvxQTM.js";
|
|
5
5
|
import { c as useDialog, l as _plugin_vue_export_helper_default, n as VDialog_default, o as createDialogStore, s as dialogKey, u as VIcon_default } from "./chunks/ImagePickerDialog-BfjNtRoR.js";
|
|
6
6
|
import { Fragment, Teleport, Transition, TransitionGroup, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, markRaw, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onErrorCaptured, onMounted, onScopeDispose, openBlock, provide, reactive, ref, renderList, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, unref, useTemplateRef, vModelText, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
7
7
|
import { getDefaultValue, localeLabel, localePath, parseLocalePath, registerFieldSchemas } from "mechanica-shared";
|
|
@@ -2262,7 +2262,8 @@ var PageBar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
2262
2262
|
const currentName = ref("");
|
|
2263
2263
|
watch(current, async (path) => {
|
|
2264
2264
|
try {
|
|
2265
|
-
|
|
2265
|
+
const pages = await fetch("/@mechanica/pages").then((response) => response.json());
|
|
2266
|
+
currentName.value = pages.find((page) => page.path === path)?.name ?? "";
|
|
2266
2267
|
} catch {}
|
|
2267
2268
|
}, { immediate: true });
|
|
2268
2269
|
const openPages = () => dialog.open(PagesDialog_default);
|
|
@@ -2329,7 +2330,8 @@ var LocaleSwitcher_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
2329
2330
|
async function refresh() {
|
|
2330
2331
|
if (!config) return;
|
|
2331
2332
|
try {
|
|
2332
|
-
|
|
2333
|
+
const pages = await fetch("/@mechanica/pages").then((r) => r.json());
|
|
2334
|
+
available.value = pages.find((p) => p.path === logicalPath.value)?.locales ?? [config.default];
|
|
2333
2335
|
} catch {
|
|
2334
2336
|
available.value = [config.default];
|
|
2335
2337
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as elements, d as usedBlockIds, f as createRouter, h as mechanicaKey, i as renderBlocks, m as useRouter, o as isElementBlock, p as useRoute, r as createComposedComponent, s as registerElements, t as createMechanica, u as loadBlocks } from "./chunks/create-mechanica-
|
|
2
|
-
import { a as registerDataEntry, i as getDataEntries, n as mountPreviewApp, r as clearDataEntries, t as buildPreviewContent } from "./chunks/preview-
|
|
1
|
+
import { a as elements, d as usedBlockIds, f as createRouter, h as mechanicaKey, i as renderBlocks, m as useRouter, o as isElementBlock, p as useRoute, r as createComposedComponent, s as registerElements, t as createMechanica, u as loadBlocks } from "./chunks/create-mechanica-CnBFiyfJ.js";
|
|
2
|
+
import { a as registerDataEntry, i as getDataEntries, n as mountPreviewApp, r as clearDataEntries, t as buildPreviewContent } from "./chunks/preview-G5_AFI5P.js";
|
|
3
3
|
import { computed, createApp, createSSRApp, defineComponent, h, inject, isReactive, onMounted, onServerPrefetch, reactive, ref, shallowReactive } from "vue";
|
|
4
4
|
import { localePath, normalizeClassManifest, passDefaultValue } from "mechanica-shared";
|
|
5
5
|
import { unfoldSchema } from "compact-json-schema";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mechanica",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.4",
|
|
4
4
|
"description": "Build Vue 3 websites with a visual block editor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"prepublishOnly": "bun run build"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"mechanica-shared": "
|
|
66
|
+
"mechanica-shared": "2.0.0-alpha.4",
|
|
67
67
|
"@vue/compiler-sfc": "^3.5.38",
|
|
68
68
|
"compact-json-schema": "^0.1.5",
|
|
69
69
|
"estree-walker": "^3.0.3",
|