@jxsuite/studio 0.26.2 → 0.28.0
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/dist/studio.js +34349 -57015
- package/dist/studio.js.map +130 -398
- package/package.json +5 -11
- package/src/browse/browse.ts +62 -22
- package/src/canvas/canvas-live-render.ts +57 -55
- package/src/canvas/canvas-render.ts +50 -21
- package/src/editor/context-menu.ts +4 -1
- package/src/editor/convert-to-component.ts +8 -2
- package/src/editor/inline-edit.ts +7 -2
- package/src/editor/insertion-helper.ts +12 -3
- package/src/editor/slash-menu.ts +5 -1
- package/src/files/file-ops.ts +121 -102
- package/src/files/files.ts +53 -35
- package/src/format/constraints.ts +55 -0
- package/src/format/format-host.ts +212 -0
- package/src/new-project/new-project-modal.ts +18 -3
- package/src/panels/ai-panel.ts +3 -1
- package/src/panels/block-action-bar.ts +4 -2
- package/src/panels/canvas-dnd.ts +78 -28
- package/src/panels/data-explorer.ts +9 -2
- package/src/panels/dnd.ts +14 -3
- package/src/panels/editors.ts +1 -1
- package/src/panels/git-panel.ts +18 -8
- package/src/panels/head-panel.ts +12 -5
- package/src/panels/left-panel.ts +7 -4
- package/src/panels/panel-events.ts +3 -1
- package/src/panels/properties-panel.ts +9 -3
- package/src/panels/quick-search.ts +10 -10
- package/src/panels/right-panel.ts +6 -2
- package/src/panels/shared.ts +6 -1
- package/src/panels/signals-panel.ts +35 -10
- package/src/panels/style-inputs.ts +5 -1
- package/src/panels/style-panel.ts +6 -2
- package/src/panels/stylebook-layers-panel.ts +12 -3
- package/src/panels/stylebook-panel.ts +24 -8
- package/src/panels/toolbar.ts +16 -3
- package/src/platforms/devserver.ts +32 -3
- package/src/resize-edges.ts +12 -2
- package/src/services/cem-export.ts +9 -3
- package/src/settings/content-types-editor.ts +7 -2
- package/src/settings/defs-editor.ts +6 -1
- package/src/settings/general-settings.ts +3 -1
- package/src/settings/schema-field-ui.ts +11 -3
- package/src/settings/settings-modal.ts +4 -1
- package/src/state.ts +5 -1
- package/src/studio.ts +27 -16
- package/src/tabs/tab.ts +29 -6
- package/src/tabs/transact.ts +9 -2
- package/src/types.ts +15 -6
- package/src/ui/button-group.ts +6 -1
- package/src/ui/expression-editor.ts +14 -3
- package/src/ui/layers.ts +5 -1
- package/src/ui/media-picker.ts +192 -43
- package/src/ui/unit-selector.ts +6 -1
- package/src/utils/canvas-media.ts +1 -1
- package/src/utils/google-fonts.ts +4 -1
- package/src/utils/studio-utils.ts +7 -1
- package/src/view.ts +8 -2
- package/src/markdown/md-allowlist.ts +0 -104
- package/src/markdown/md-convert.ts +0 -846
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Md-allowlist.js — Markdown element allowlist and nesting constraints
|
|
3
|
-
*
|
|
4
|
-
* Defines which HTML elements are "native markdown" — they round-trip to pure markdown syntax.
|
|
5
|
-
* Everything else is a Jx component directive.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/** Block-level elements that map directly to markdown syntax */
|
|
9
|
-
export const MD_BLOCK = new Set([
|
|
10
|
-
"h1",
|
|
11
|
-
"h2",
|
|
12
|
-
"h3",
|
|
13
|
-
"h4",
|
|
14
|
-
"h5",
|
|
15
|
-
"h6",
|
|
16
|
-
"p",
|
|
17
|
-
"blockquote",
|
|
18
|
-
"ul",
|
|
19
|
-
"ol",
|
|
20
|
-
"li",
|
|
21
|
-
"pre",
|
|
22
|
-
"hr",
|
|
23
|
-
"table",
|
|
24
|
-
"thead",
|
|
25
|
-
"tbody",
|
|
26
|
-
"tr",
|
|
27
|
-
"th",
|
|
28
|
-
"td",
|
|
29
|
-
]);
|
|
30
|
-
|
|
31
|
-
/** Inline elements that map directly to markdown syntax */
|
|
32
|
-
export const MD_INLINE = new Set(["em", "strong", "del", "code", "a", "img", "br"]);
|
|
33
|
-
|
|
34
|
-
/** All markdown-native elements */
|
|
35
|
-
export const MD_ALL = new Set([...MD_BLOCK, ...MD_INLINE]);
|
|
36
|
-
|
|
37
|
-
/** Elements that cannot contain children */
|
|
38
|
-
export const MD_VOID = new Set(["hr", "br", "img"]);
|
|
39
|
-
|
|
40
|
-
/** Elements that contain only text, not child elements */
|
|
41
|
-
export const MD_TEXT_ONLY = new Set(["code"]);
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Nesting constraints: which child elements are allowed inside each parent. null = any block/inline
|
|
45
|
-
* allowed (used for content root and directive components).
|
|
46
|
-
*
|
|
47
|
-
* @type {Record<
|
|
48
|
-
* string,
|
|
49
|
-
* { block: boolean; inline: boolean; directive: boolean; only: Set<string> | null }
|
|
50
|
-
* >}
|
|
51
|
-
*/
|
|
52
|
-
export const MD_NESTING: Record<
|
|
53
|
-
string,
|
|
54
|
-
{ block: boolean; inline: boolean; directive: boolean; only: Set<string> | null }
|
|
55
|
-
> = {
|
|
56
|
-
_root: { block: true, inline: false, directive: true, only: null },
|
|
57
|
-
h1: { block: false, inline: true, directive: false, only: null },
|
|
58
|
-
h2: { block: false, inline: true, directive: false, only: null },
|
|
59
|
-
h3: { block: false, inline: true, directive: false, only: null },
|
|
60
|
-
h4: { block: false, inline: true, directive: false, only: null },
|
|
61
|
-
h5: { block: false, inline: true, directive: false, only: null },
|
|
62
|
-
h6: { block: false, inline: true, directive: false, only: null },
|
|
63
|
-
p: { block: false, inline: true, directive: true, only: null },
|
|
64
|
-
blockquote: { block: true, inline: false, directive: true, only: null },
|
|
65
|
-
ul: { block: false, inline: false, directive: false, only: new Set(["li"]) },
|
|
66
|
-
ol: { block: false, inline: false, directive: false, only: new Set(["li"]) },
|
|
67
|
-
li: { block: true, inline: true, directive: true, only: null },
|
|
68
|
-
pre: { block: false, inline: false, directive: false, only: new Set(["code"]) },
|
|
69
|
-
table: { block: false, inline: false, directive: false, only: new Set(["thead", "tbody"]) },
|
|
70
|
-
thead: { block: false, inline: false, directive: false, only: new Set(["tr"]) },
|
|
71
|
-
tbody: { block: false, inline: false, directive: false, only: new Set(["tr"]) },
|
|
72
|
-
tr: { block: false, inline: false, directive: false, only: new Set(["th", "td"]) },
|
|
73
|
-
th: { block: false, inline: true, directive: false, only: null },
|
|
74
|
-
td: { block: false, inline: true, directive: false, only: null },
|
|
75
|
-
em: { block: false, inline: true, directive: false, only: null },
|
|
76
|
-
strong: { block: false, inline: true, directive: false, only: null },
|
|
77
|
-
del: { block: false, inline: true, directive: false, only: null },
|
|
78
|
-
a: { block: false, inline: true, directive: false, only: null },
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Check whether a tag is allowed as a child of the given parent tag in content mode.
|
|
83
|
-
*
|
|
84
|
-
* @param {string} parentTag - Parent element tag (or '_root' for content root)
|
|
85
|
-
* @param {string} childTag - Proposed child element tag
|
|
86
|
-
* @returns {boolean}
|
|
87
|
-
*/
|
|
88
|
-
export function isValidChild(parentTag: string, childTag: string) {
|
|
89
|
-
const rule = MD_NESTING[parentTag];
|
|
90
|
-
if (!rule) return true; // directive components allow anything
|
|
91
|
-
|
|
92
|
-
// If there's a strict allowlist, check it
|
|
93
|
-
if (rule.only) return rule.only.has(childTag);
|
|
94
|
-
|
|
95
|
-
const isBlock = MD_BLOCK.has(childTag);
|
|
96
|
-
const isInline = MD_INLINE.has(childTag);
|
|
97
|
-
const isDirective = !MD_ALL.has(childTag);
|
|
98
|
-
|
|
99
|
-
if (isBlock && rule.block) return true;
|
|
100
|
-
if (isInline && rule.inline) return true;
|
|
101
|
-
if (isDirective && rule.directive) return true;
|
|
102
|
-
|
|
103
|
-
return false;
|
|
104
|
-
}
|