laif-ds 0.2.78 → 0.2.80
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/CHANGELOG.md +25 -0
- package/dist/_virtual/index3.js +5 -5
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +4 -4
- package/dist/agent-docs/adoption-report.json +10 -10
- package/dist/agent-docs/components/AppEditor.md +4 -4
- package/dist/agent-docs/components/AppSelect.md +46 -0
- package/dist/agent-docs/manifest.json +5 -3
- package/dist/components/editor/editor-ui/content-editable.js +15 -8
- package/dist/components/ui/app-editor.js +88 -76
- package/dist/components/ui/app-select.js +232 -143
- package/dist/components/ui/date-picker.js +184 -153
- package/dist/components/ui/markdown-renderer.js +40 -30
- package/dist/index.d.ts +3 -1
- package/dist/node_modules/comma-separated-tokens/index.js +16 -5
- package/dist/node_modules/entities/dist/esm/decode-codepoint.js +39 -0
- package/dist/node_modules/entities/dist/esm/decode.js +246 -0
- package/dist/node_modules/entities/dist/esm/generated/decode-data-html.js +8 -0
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/hast-util-from-parse5/lib/index.js +146 -0
- package/dist/node_modules/hast-util-parse-selector/lib/index.js +21 -0
- package/dist/node_modules/hast-util-raw/lib/index.js +218 -0
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/hast-util-to-parse5/lib/index.js +119 -0
- package/dist/node_modules/hastscript/lib/create-h.js +113 -0
- package/dist/node_modules/hastscript/lib/index.js +9 -0
- package/dist/node_modules/hastscript/lib/svg-case-sensitive-tag-names.js +45 -0
- package/dist/node_modules/parse5/dist/common/doctype.js +99 -0
- package/dist/node_modules/parse5/dist/common/error-codes.js +8 -0
- package/dist/node_modules/parse5/dist/common/foreign-content.js +211 -0
- package/dist/node_modules/parse5/dist/common/html.js +251 -0
- package/dist/node_modules/parse5/dist/common/token.js +15 -0
- package/dist/node_modules/parse5/dist/common/unicode.js +74 -0
- package/dist/node_modules/parse5/dist/parser/formatting-element-list.js +85 -0
- package/dist/node_modules/parse5/dist/parser/index.js +2272 -0
- package/dist/node_modules/parse5/dist/parser/open-element-stack.js +241 -0
- package/dist/node_modules/parse5/dist/serializer/index.js +3 -0
- package/dist/node_modules/parse5/dist/tokenizer/index.js +1941 -0
- package/dist/node_modules/parse5/dist/tokenizer/preprocessor.js +89 -0
- package/dist/node_modules/parse5/dist/tree-adapters/default.js +163 -0
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/rehype-raw/lib/index.js +13 -0
- package/dist/node_modules/space-separated-tokens/index.js +8 -3
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/node_modules/vfile-location/lib/index.js +43 -0
- package/dist/node_modules/web-namespaces/index.js +12 -0
- package/dist/styles.v3.css +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { TAG_ID as t, NS as n, NUMBERED_HEADERS as h } from "../common/html.js";
|
|
3
|
+
const p = /* @__PURE__ */ new Set([t.DD, t.DT, t.LI, t.OPTGROUP, t.OPTION, t.P, t.RB, t.RP, t.RT, t.RTC]), T = /* @__PURE__ */ new Set([
|
|
4
|
+
...p,
|
|
5
|
+
t.CAPTION,
|
|
6
|
+
t.COLGROUP,
|
|
7
|
+
t.TBODY,
|
|
8
|
+
t.TD,
|
|
9
|
+
t.TFOOT,
|
|
10
|
+
t.TH,
|
|
11
|
+
t.THEAD,
|
|
12
|
+
t.TR
|
|
13
|
+
]), a = /* @__PURE__ */ new Set([
|
|
14
|
+
t.APPLET,
|
|
15
|
+
t.CAPTION,
|
|
16
|
+
t.HTML,
|
|
17
|
+
t.MARQUEE,
|
|
18
|
+
t.OBJECT,
|
|
19
|
+
t.TABLE,
|
|
20
|
+
t.TD,
|
|
21
|
+
t.TEMPLATE,
|
|
22
|
+
t.TH
|
|
23
|
+
]), u = /* @__PURE__ */ new Set([...a, t.OL, t.UL]), l = /* @__PURE__ */ new Set([...a, t.BUTTON]), o = /* @__PURE__ */ new Set([t.ANNOTATION_XML, t.MI, t.MN, t.MO, t.MS, t.MTEXT]), c = /* @__PURE__ */ new Set([t.DESC, t.FOREIGN_OBJECT, t.TITLE]), d = /* @__PURE__ */ new Set([t.TR, t.TEMPLATE, t.HTML]), I = /* @__PURE__ */ new Set([t.TBODY, t.TFOOT, t.THEAD, t.TEMPLATE, t.HTML]), m = /* @__PURE__ */ new Set([t.TABLE, t.TEMPLATE, t.HTML]), E = /* @__PURE__ */ new Set([t.TD, t.TH]);
|
|
24
|
+
class f {
|
|
25
|
+
get currentTmplContentOrNode() {
|
|
26
|
+
return this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : this.current;
|
|
27
|
+
}
|
|
28
|
+
constructor(e, s, i) {
|
|
29
|
+
this.treeAdapter = s, this.handler = i, this.items = [], this.tagIDs = [], this.stackTop = -1, this.tmplCount = 0, this.currentTagId = t.UNKNOWN, this.current = e;
|
|
30
|
+
}
|
|
31
|
+
//Index of element
|
|
32
|
+
_indexOf(e) {
|
|
33
|
+
return this.items.lastIndexOf(e, this.stackTop);
|
|
34
|
+
}
|
|
35
|
+
//Update current element
|
|
36
|
+
_isInTemplate() {
|
|
37
|
+
return this.currentTagId === t.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === n.HTML;
|
|
38
|
+
}
|
|
39
|
+
_updateCurrentElement() {
|
|
40
|
+
this.current = this.items[this.stackTop], this.currentTagId = this.tagIDs[this.stackTop];
|
|
41
|
+
}
|
|
42
|
+
//Mutations
|
|
43
|
+
push(e, s) {
|
|
44
|
+
this.stackTop++, this.items[this.stackTop] = e, this.current = e, this.tagIDs[this.stackTop] = s, this.currentTagId = s, this._isInTemplate() && this.tmplCount++, this.handler.onItemPush(e, s, !0);
|
|
45
|
+
}
|
|
46
|
+
pop() {
|
|
47
|
+
const e = this.current;
|
|
48
|
+
this.tmplCount > 0 && this._isInTemplate() && this.tmplCount--, this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(e, !0);
|
|
49
|
+
}
|
|
50
|
+
replace(e, s) {
|
|
51
|
+
const i = this._indexOf(e);
|
|
52
|
+
this.items[i] = s, i === this.stackTop && (this.current = s);
|
|
53
|
+
}
|
|
54
|
+
insertAfter(e, s, i) {
|
|
55
|
+
const r = this._indexOf(e) + 1;
|
|
56
|
+
this.items.splice(r, 0, s), this.tagIDs.splice(r, 0, i), this.stackTop++, r === this.stackTop && this._updateCurrentElement(), this.current && this.currentTagId !== void 0 && this.handler.onItemPush(this.current, this.currentTagId, r === this.stackTop);
|
|
57
|
+
}
|
|
58
|
+
popUntilTagNamePopped(e) {
|
|
59
|
+
let s = this.stackTop + 1;
|
|
60
|
+
do
|
|
61
|
+
s = this.tagIDs.lastIndexOf(e, s - 1);
|
|
62
|
+
while (s > 0 && this.treeAdapter.getNamespaceURI(this.items[s]) !== n.HTML);
|
|
63
|
+
this.shortenToLength(Math.max(s, 0));
|
|
64
|
+
}
|
|
65
|
+
shortenToLength(e) {
|
|
66
|
+
for (; this.stackTop >= e; ) {
|
|
67
|
+
const s = this.current;
|
|
68
|
+
this.tmplCount > 0 && this._isInTemplate() && (this.tmplCount -= 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(s, this.stackTop < e);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
popUntilElementPopped(e) {
|
|
72
|
+
const s = this._indexOf(e);
|
|
73
|
+
this.shortenToLength(Math.max(s, 0));
|
|
74
|
+
}
|
|
75
|
+
popUntilPopped(e, s) {
|
|
76
|
+
const i = this._indexOfTagNames(e, s);
|
|
77
|
+
this.shortenToLength(Math.max(i, 0));
|
|
78
|
+
}
|
|
79
|
+
popUntilNumberedHeaderPopped() {
|
|
80
|
+
this.popUntilPopped(h, n.HTML);
|
|
81
|
+
}
|
|
82
|
+
popUntilTableCellPopped() {
|
|
83
|
+
this.popUntilPopped(E, n.HTML);
|
|
84
|
+
}
|
|
85
|
+
popAllUpToHtmlElement() {
|
|
86
|
+
this.tmplCount = 0, this.shortenToLength(1);
|
|
87
|
+
}
|
|
88
|
+
_indexOfTagNames(e, s) {
|
|
89
|
+
for (let i = this.stackTop; i >= 0; i--)
|
|
90
|
+
if (e.has(this.tagIDs[i]) && this.treeAdapter.getNamespaceURI(this.items[i]) === s)
|
|
91
|
+
return i;
|
|
92
|
+
return -1;
|
|
93
|
+
}
|
|
94
|
+
clearBackTo(e, s) {
|
|
95
|
+
const i = this._indexOfTagNames(e, s);
|
|
96
|
+
this.shortenToLength(i + 1);
|
|
97
|
+
}
|
|
98
|
+
clearBackToTableContext() {
|
|
99
|
+
this.clearBackTo(m, n.HTML);
|
|
100
|
+
}
|
|
101
|
+
clearBackToTableBodyContext() {
|
|
102
|
+
this.clearBackTo(I, n.HTML);
|
|
103
|
+
}
|
|
104
|
+
clearBackToTableRowContext() {
|
|
105
|
+
this.clearBackTo(d, n.HTML);
|
|
106
|
+
}
|
|
107
|
+
remove(e) {
|
|
108
|
+
const s = this._indexOf(e);
|
|
109
|
+
s >= 0 && (s === this.stackTop ? this.pop() : (this.items.splice(s, 1), this.tagIDs.splice(s, 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(e, !1)));
|
|
110
|
+
}
|
|
111
|
+
//Search
|
|
112
|
+
tryPeekProperlyNestedBodyElement() {
|
|
113
|
+
return this.stackTop >= 1 && this.tagIDs[1] === t.BODY ? this.items[1] : null;
|
|
114
|
+
}
|
|
115
|
+
contains(e) {
|
|
116
|
+
return this._indexOf(e) > -1;
|
|
117
|
+
}
|
|
118
|
+
getCommonAncestor(e) {
|
|
119
|
+
const s = this._indexOf(e) - 1;
|
|
120
|
+
return s >= 0 ? this.items[s] : null;
|
|
121
|
+
}
|
|
122
|
+
isRootHtmlElementCurrent() {
|
|
123
|
+
return this.stackTop === 0 && this.tagIDs[0] === t.HTML;
|
|
124
|
+
}
|
|
125
|
+
//Element in scope
|
|
126
|
+
hasInDynamicScope(e, s) {
|
|
127
|
+
for (let i = this.stackTop; i >= 0; i--) {
|
|
128
|
+
const r = this.tagIDs[i];
|
|
129
|
+
switch (this.treeAdapter.getNamespaceURI(this.items[i])) {
|
|
130
|
+
case n.HTML: {
|
|
131
|
+
if (r === e)
|
|
132
|
+
return !0;
|
|
133
|
+
if (s.has(r))
|
|
134
|
+
return !1;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
case n.SVG: {
|
|
138
|
+
if (c.has(r))
|
|
139
|
+
return !1;
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
case n.MATHML: {
|
|
143
|
+
if (o.has(r))
|
|
144
|
+
return !1;
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return !0;
|
|
150
|
+
}
|
|
151
|
+
hasInScope(e) {
|
|
152
|
+
return this.hasInDynamicScope(e, a);
|
|
153
|
+
}
|
|
154
|
+
hasInListItemScope(e) {
|
|
155
|
+
return this.hasInDynamicScope(e, u);
|
|
156
|
+
}
|
|
157
|
+
hasInButtonScope(e) {
|
|
158
|
+
return this.hasInDynamicScope(e, l);
|
|
159
|
+
}
|
|
160
|
+
hasNumberedHeaderInScope() {
|
|
161
|
+
for (let e = this.stackTop; e >= 0; e--) {
|
|
162
|
+
const s = this.tagIDs[e];
|
|
163
|
+
switch (this.treeAdapter.getNamespaceURI(this.items[e])) {
|
|
164
|
+
case n.HTML: {
|
|
165
|
+
if (h.has(s))
|
|
166
|
+
return !0;
|
|
167
|
+
if (a.has(s))
|
|
168
|
+
return !1;
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
case n.SVG: {
|
|
172
|
+
if (c.has(s))
|
|
173
|
+
return !1;
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
case n.MATHML: {
|
|
177
|
+
if (o.has(s))
|
|
178
|
+
return !1;
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return !0;
|
|
184
|
+
}
|
|
185
|
+
hasInTableScope(e) {
|
|
186
|
+
for (let s = this.stackTop; s >= 0; s--)
|
|
187
|
+
if (this.treeAdapter.getNamespaceURI(this.items[s]) === n.HTML)
|
|
188
|
+
switch (this.tagIDs[s]) {
|
|
189
|
+
case e:
|
|
190
|
+
return !0;
|
|
191
|
+
case t.TABLE:
|
|
192
|
+
case t.HTML:
|
|
193
|
+
return !1;
|
|
194
|
+
}
|
|
195
|
+
return !0;
|
|
196
|
+
}
|
|
197
|
+
hasTableBodyContextInTableScope() {
|
|
198
|
+
for (let e = this.stackTop; e >= 0; e--)
|
|
199
|
+
if (this.treeAdapter.getNamespaceURI(this.items[e]) === n.HTML)
|
|
200
|
+
switch (this.tagIDs[e]) {
|
|
201
|
+
case t.TBODY:
|
|
202
|
+
case t.THEAD:
|
|
203
|
+
case t.TFOOT:
|
|
204
|
+
return !0;
|
|
205
|
+
case t.TABLE:
|
|
206
|
+
case t.HTML:
|
|
207
|
+
return !1;
|
|
208
|
+
}
|
|
209
|
+
return !0;
|
|
210
|
+
}
|
|
211
|
+
hasInSelectScope(e) {
|
|
212
|
+
for (let s = this.stackTop; s >= 0; s--)
|
|
213
|
+
if (this.treeAdapter.getNamespaceURI(this.items[s]) === n.HTML)
|
|
214
|
+
switch (this.tagIDs[s]) {
|
|
215
|
+
case e:
|
|
216
|
+
return !0;
|
|
217
|
+
case t.OPTION:
|
|
218
|
+
case t.OPTGROUP:
|
|
219
|
+
break;
|
|
220
|
+
default:
|
|
221
|
+
return !1;
|
|
222
|
+
}
|
|
223
|
+
return !0;
|
|
224
|
+
}
|
|
225
|
+
//Implied end tags
|
|
226
|
+
generateImpliedEndTags() {
|
|
227
|
+
for (; this.currentTagId !== void 0 && p.has(this.currentTagId); )
|
|
228
|
+
this.pop();
|
|
229
|
+
}
|
|
230
|
+
generateImpliedEndTagsThoroughly() {
|
|
231
|
+
for (; this.currentTagId !== void 0 && T.has(this.currentTagId); )
|
|
232
|
+
this.pop();
|
|
233
|
+
}
|
|
234
|
+
generateImpliedEndTagsWithExclusion(e) {
|
|
235
|
+
for (; this.currentTagId !== void 0 && this.currentTagId !== e && T.has(this.currentTagId); )
|
|
236
|
+
this.pop();
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
export {
|
|
240
|
+
f as OpenElementStack
|
|
241
|
+
};
|