@jbpark/live-editor 4.6.0 → 5.0.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/README.ko.md +2 -2
- package/README.md +2 -2
- package/dist/{boundary-BLB80tyw.js → boundary-6_nTsWxP.js} +2 -2
- package/dist/{boundary-BLB80tyw.js.map → boundary-6_nTsWxP.js.map} +1 -1
- package/dist/{compile-Dxas-D05.js → compile-DwOyWrmI.js} +8 -7
- package/dist/compile-DwOyWrmI.js.map +1 -0
- package/dist/constants-D-XKuEY2.js +58 -0
- package/dist/constants-D-XKuEY2.js.map +1 -0
- package/dist/{context-B8MzP7_p.js → context-DDR1xVKo.js} +3 -3
- package/dist/{context-B8MzP7_p.js.map → context-DDR1xVKo.js.map} +1 -1
- package/dist/{core-Bgfek364.js → core-CKazr4tT.js} +2 -2
- package/dist/core-CKazr4tT.js.map +1 -0
- package/dist/{detect-typescript-Dr_oLniM.js → detect-typescript-CoAO-QUJ.js} +2 -2
- package/dist/{detect-typescript-Dr_oLniM.js.map → detect-typescript-CoAO-QUJ.js.map} +1 -1
- package/dist/dnd/index.d.ts +2 -2
- package/dist/dnd/index.js +2 -2
- package/dist/dnd-BlC1gqUy.js +4446 -0
- package/dist/dnd-BlC1gqUy.js.map +1 -0
- package/dist/document-BQhb7YR8.d.ts +17 -0
- package/dist/document-DcwIEHRV.js +34077 -0
- package/dist/document-DcwIEHRV.js.map +1 -0
- package/dist/editor/index.js +2 -2
- package/dist/{editor-CMElfHer.js → editor-Bty5XzpV.js} +2 -2
- package/dist/{editor-CMElfHer.js.map → editor-Bty5XzpV.js.map} +1 -1
- package/dist/error/index.d.ts +1 -1
- package/dist/error/index.js +2 -2
- package/dist/{error-CN_GCnXB.js → error-DyYx2NQ2.js} +17 -31
- package/dist/error-DyYx2NQ2.js.map +1 -0
- package/dist/{index-C69Lv-jR.d.ts → index-0VB5C3Jk.d.ts} +28 -50
- package/dist/{index-DpDU1IAw.d.ts → index-92L7F440.d.ts} +2 -2
- package/dist/index-C8h8TcIl.d.ts +15 -0
- package/dist/{index-DQkL37eL.d.ts → index-Cl79M7ZJ.d.ts} +6 -4
- package/dist/{index-CRwEhJ7w.d.ts → index-kKUjo9lr.d.ts} +2 -2
- package/dist/{index-DrWtSKXu.d.ts → index-tAiuHZsC.d.ts} +2 -2
- package/dist/index.d.ts +9 -9
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/{messages-CSrMI4Rm.js → messages-Bt5WXKTE.js} +5 -2
- package/dist/messages-Bt5WXKTE.js.map +1 -0
- package/dist/{messages-IBPs4TkZ.d.ts → messages-Yb3b7YJt.d.ts} +5 -2
- package/dist/preview/index.d.ts +1 -1
- package/dist/preview/index.js +2 -2
- package/dist/{preview-CtyG5UbH.js → preview-DC0pyOdu.js} +4 -4
- package/dist/preview-DC0pyOdu.js.map +1 -0
- package/dist/provider/index.d.ts +2 -2
- package/dist/provider/index.js +2 -2
- package/dist/{sections-BYWOBISr.js → sections-4uirsXRU.js} +4 -7
- package/dist/sections-4uirsXRU.js.map +1 -0
- package/dist/style.css +776 -346
- package/dist/{validate-DB59Z_Nx.d.ts → types-Czps1Txy.d.ts} +12 -28
- package/dist/update-2PJbwoS8.d.ts +68 -0
- package/dist/{items-B6OXxcLG.js → update-DNInQSM7.js} +261 -512
- package/dist/update-DNInQSM7.js.map +1 -0
- package/dist/{use-dynamic-tailwind-BP1toJkW.js → use-dynamic-tailwind-CSYKXDmX.js} +301 -273
- package/dist/use-dynamic-tailwind-CSYKXDmX.js.map +1 -0
- package/dist/utils/ast/index.d.ts +47 -4
- package/dist/utils/ast/index.js +15 -77
- package/dist/utils/ast/index.js.map +1 -1
- package/dist/utils/index.d.ts +13 -32
- package/dist/utils/index.js +4 -26
- package/dist/validate-CZz30Pnb.js +122 -0
- package/dist/validate-CZz30Pnb.js.map +1 -0
- package/dist/validate-CiA1LF6S.d.ts +33 -0
- package/package.json +13 -15
- package/dist/compile-Dxas-D05.js.map +0 -1
- package/dist/constants-DU17Tdwo.js +0 -1459
- package/dist/constants-DU17Tdwo.js.map +0 -1
- package/dist/core-Bgfek364.js.map +0 -1
- package/dist/dnd-UoJILA75.js +0 -2756
- package/dist/dnd-UoJILA75.js.map +0 -1
- package/dist/document-CGbe6bSV.js +0 -38667
- package/dist/document-CGbe6bSV.js.map +0 -1
- package/dist/document-Ct4jW78J.d.ts +0 -1553
- package/dist/error-CN_GCnXB.js.map +0 -1
- package/dist/index-DKYUxi-E.d.ts +0 -227
- package/dist/items-B6OXxcLG.js.map +0 -1
- package/dist/messages-CSrMI4Rm.js.map +0 -1
- package/dist/preview-CtyG5UbH.js.map +0 -1
- package/dist/sections-BYWOBISr.js.map +0 -1
- package/dist/use-dynamic-tailwind-BP1toJkW.js.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/validate-iLo8IONY.js +0 -64
- package/dist/validate-iLo8IONY.js.map +0 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
//#region src/utils/ast/validate.ts
|
|
2
|
+
const defaultValidationMessages = {
|
|
3
|
+
required: "This field is required.",
|
|
4
|
+
min: (min) => `Must be at least ${min}.`,
|
|
5
|
+
max: (max) => `Must be at most ${max}.`,
|
|
6
|
+
pattern: "Value does not match the required format.",
|
|
7
|
+
url: "Must be a valid URL.",
|
|
8
|
+
date: "Must be a valid date.",
|
|
9
|
+
time: "Must be a valid time.",
|
|
10
|
+
datetime: "Must be a valid date and time.",
|
|
11
|
+
email: "Must be a valid email address.",
|
|
12
|
+
minLength: (minLength) => `Must be at least ${minLength} character${minLength === 1 ? "" : "s"}.`,
|
|
13
|
+
maxLength: (maxLength) => `Must be at most ${maxLength} character${maxLength === 1 ? "" : "s"}.`,
|
|
14
|
+
step: (step) => `Must be in steps of ${step}.`,
|
|
15
|
+
minItems: (minItems) => `Must have at least ${minItems} item${minItems === 1 ? "" : "s"}.`,
|
|
16
|
+
maxItems: (maxItems) => `Must have at most ${maxItems} item${maxItems === 1 ? "" : "s"}.`,
|
|
17
|
+
minDate: (minDate) => `Must be on or after ${minDate}.`,
|
|
18
|
+
maxDate: (maxDate) => `Must be on or before ${maxDate}.`,
|
|
19
|
+
protocol: (protocols) => `Must use ${protocols.join(", ")}.`
|
|
20
|
+
};
|
|
21
|
+
const VALID = { valid: true };
|
|
22
|
+
const STEP_TOLERANCE = 1e-9;
|
|
23
|
+
const ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
24
|
+
const TIME = /^([01]\d|2[0-3]):[0-5]\d$/;
|
|
25
|
+
const isDateTime = (value) => {
|
|
26
|
+
const [date, time, ...rest] = value.split("T");
|
|
27
|
+
return rest.length === 0 && date !== void 0 && time !== void 0 && isCalendarDate(date) && TIME.test(time);
|
|
28
|
+
};
|
|
29
|
+
const compareToBound = (value, bound) => {
|
|
30
|
+
const length = Math.min(value.length, bound.length);
|
|
31
|
+
const a = value.slice(0, length);
|
|
32
|
+
const b = bound.slice(0, length);
|
|
33
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
34
|
+
};
|
|
35
|
+
const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
36
|
+
const isCalendarDate = (value) => {
|
|
37
|
+
const match = ISO_DATE.exec(value);
|
|
38
|
+
if (!match) return false;
|
|
39
|
+
const [year, month, day] = match.slice(1).map(Number);
|
|
40
|
+
const date = new Date(Date.UTC(year, month - 1, day));
|
|
41
|
+
return date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day;
|
|
42
|
+
};
|
|
43
|
+
const normalizeProtocol = (protocol) => `${protocol.toLowerCase().replace(/:$/, "")}:`;
|
|
44
|
+
const invalid = (message) => ({
|
|
45
|
+
valid: false,
|
|
46
|
+
message
|
|
47
|
+
});
|
|
48
|
+
const validateBindingValue = (binding, value, options = {}) => {
|
|
49
|
+
const messages = {
|
|
50
|
+
...defaultValidationMessages,
|
|
51
|
+
...options.messages
|
|
52
|
+
};
|
|
53
|
+
if (value === "" || value === null || value === void 0) {
|
|
54
|
+
if (binding.required) return {
|
|
55
|
+
valid: false,
|
|
56
|
+
message: messages.required
|
|
57
|
+
};
|
|
58
|
+
return VALID;
|
|
59
|
+
}
|
|
60
|
+
if (typeof value === "number") {
|
|
61
|
+
if (binding.min !== void 0 && value < binding.min) return {
|
|
62
|
+
valid: false,
|
|
63
|
+
message: messages.min(binding.min)
|
|
64
|
+
};
|
|
65
|
+
if (binding.max !== void 0 && value > binding.max) return {
|
|
66
|
+
valid: false,
|
|
67
|
+
message: messages.max(binding.max)
|
|
68
|
+
};
|
|
69
|
+
if (binding.step !== void 0 && binding.step > 0) {
|
|
70
|
+
const steps = (value - (binding.min ?? 0)) / binding.step;
|
|
71
|
+
if (Math.abs(steps - Math.round(steps)) > STEP_TOLERANCE) return invalid(messages.step(binding.step));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (typeof value === "string") {
|
|
75
|
+
const length = [...value].length;
|
|
76
|
+
if (binding.minLength !== void 0 && length < binding.minLength) return invalid(messages.minLength(binding.minLength));
|
|
77
|
+
if (binding.maxLength !== void 0 && length > binding.maxLength) return invalid(messages.maxLength(binding.maxLength));
|
|
78
|
+
}
|
|
79
|
+
if (Array.isArray(value)) {
|
|
80
|
+
if (binding.minItems !== void 0 && value.length < binding.minItems) return invalid(messages.minItems(binding.minItems));
|
|
81
|
+
if (binding.maxItems !== void 0 && value.length > binding.maxItems) return invalid(messages.maxItems(binding.maxItems));
|
|
82
|
+
}
|
|
83
|
+
if (typeof value === "string" && binding.pattern) {
|
|
84
|
+
let regex;
|
|
85
|
+
try {
|
|
86
|
+
regex = new RegExp(binding.pattern);
|
|
87
|
+
} catch {
|
|
88
|
+
return VALID;
|
|
89
|
+
}
|
|
90
|
+
if (!regex.test(value)) return invalid(binding.patternMessage ?? messages.pattern);
|
|
91
|
+
}
|
|
92
|
+
if (typeof value === "string" && binding.type === "url") {
|
|
93
|
+
let url;
|
|
94
|
+
try {
|
|
95
|
+
url = new URL(value);
|
|
96
|
+
} catch {
|
|
97
|
+
return {
|
|
98
|
+
valid: false,
|
|
99
|
+
message: messages.url
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
if (binding.protocols?.length) {
|
|
103
|
+
const allowed = binding.protocols.map(normalizeProtocol);
|
|
104
|
+
if (!allowed.includes(url.protocol)) return invalid(messages.protocol(allowed));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (typeof value === "string" && binding.type === "time") {
|
|
108
|
+
if (!TIME.test(value)) return invalid(messages.time);
|
|
109
|
+
}
|
|
110
|
+
if (typeof value === "string" && (binding.type === "date" || binding.type === "datetime")) {
|
|
111
|
+
if (binding.type === "date" && !isCalendarDate(value)) return invalid(messages.date);
|
|
112
|
+
if (binding.type === "datetime" && !isDateTime(value)) return invalid(messages.datetime);
|
|
113
|
+
if (binding.minDate !== void 0 && compareToBound(value, binding.minDate) < 0) return invalid(messages.minDate(binding.minDate));
|
|
114
|
+
if (binding.maxDate !== void 0 && compareToBound(value, binding.maxDate) > 0) return invalid(messages.maxDate(binding.maxDate));
|
|
115
|
+
}
|
|
116
|
+
if (typeof value === "string" && binding.type === "email" && !EMAIL.test(value)) return invalid(messages.email);
|
|
117
|
+
return VALID;
|
|
118
|
+
};
|
|
119
|
+
//#endregion
|
|
120
|
+
export { validateBindingValue as n, defaultValidationMessages as t };
|
|
121
|
+
|
|
122
|
+
//# sourceMappingURL=validate-CZz30Pnb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-CZz30Pnb.js","names":[],"sources":["../src/utils/ast/validate.ts"],"sourcesContent":["import type { BindingItem } from './types';\n\nexport interface ValidationResult {\n valid: boolean;\n message?: string;\n}\n\n// The messages a failed check returns. Pass your own through `options` to\n// translate them; the built-in panel passes the provider's `validation`\n// messages (#524).\nexport interface ValidationMessages {\n required: string;\n min: (min: number) => string;\n max: (max: number) => string;\n pattern: string;\n url: string;\n date: string;\n time: string;\n datetime: string;\n email: string;\n minLength: (minLength: number) => string;\n maxLength: (maxLength: number) => string;\n step: (step: number) => string;\n minItems: (minItems: number) => string;\n maxItems: (maxItems: number) => string;\n minDate: (minDate: string) => string;\n maxDate: (maxDate: string) => string;\n // The allowed schemes, normalized to end with `:`.\n protocol: (protocols: string[]) => string;\n}\n\nexport const defaultValidationMessages: ValidationMessages = {\n required: 'This field is required.',\n min: min => `Must be at least ${min}.`,\n max: max => `Must be at most ${max}.`,\n pattern: 'Value does not match the required format.',\n url: 'Must be a valid URL.',\n date: 'Must be a valid date.',\n time: 'Must be a valid time.',\n datetime: 'Must be a valid date and time.',\n email: 'Must be a valid email address.',\n minLength: minLength =>\n `Must be at least ${minLength} character${minLength === 1 ? '' : 's'}.`,\n maxLength: maxLength =>\n `Must be at most ${maxLength} character${maxLength === 1 ? '' : 's'}.`,\n step: step => `Must be in steps of ${step}.`,\n minItems: minItems =>\n `Must have at least ${minItems} item${minItems === 1 ? '' : 's'}.`,\n maxItems: maxItems =>\n `Must have at most ${maxItems} item${maxItems === 1 ? '' : 's'}.`,\n minDate: minDate => `Must be on or after ${minDate}.`,\n maxDate: maxDate => `Must be on or before ${maxDate}.`,\n protocol: protocols => `Must use ${protocols.join(', ')}.`,\n};\n\nexport interface ValidationOptions {\n messages?: Partial<ValidationMessages>;\n}\n\nconst VALID: ValidationResult = { valid: true };\n\n// How close a number has to be to a whole number of steps, so `0.3` passes\n// `step: 0.1` despite floating-point error.\nconst STEP_TOLERANCE = 1e-9;\n\nconst ISO_DATE = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\n\n// A 24-hour `HH:mm`, the format the built-in time picker writes.\nconst TIME = /^([01]\\d|2[0-3]):[0-5]\\d$/;\n\n// `YYYY-MM-DDTHH:mm` in local time with no zone, as `datetime-local` writes\n// it, naming a day that exists.\nconst isDateTime = (value: string) => {\n const [date, time, ...rest] = value.split('T');\n\n return (\n rest.length === 0 &&\n date !== undefined &&\n time !== undefined &&\n isCalendarDate(date) &&\n TIME.test(time)\n );\n};\n\n// Compares a date or date-time with a `minDate`/`maxDate` bound at the\n// coarser of the two, so a date-only bound covers that whole day. The\n// formats sort by time, so they compare as text.\nconst compareToBound = (value: string, bound: string) => {\n const length = Math.min(value.length, bound.length);\n const a = value.slice(0, length);\n const b = bound.slice(0, length);\n\n return a < b ? -1 : a > b ? 1 : 0;\n};\n\n// A basic `local@domain.tld` check: no spaces, one `@`, a dot in the domain.\n// Anything stricter rejects real addresses.\nconst EMAIL = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\n// `YYYY-MM-DD` naming a day that exists, so `2026-02-30` fails. This is the\n// format the built-in date picker writes.\nconst isCalendarDate = (value: string) => {\n const match = ISO_DATE.exec(value);\n\n if (!match) {\n return false;\n }\n\n const [year, month, day] = match.slice(1).map(Number) as [\n number,\n number,\n number,\n ];\n const date = new Date(Date.UTC(year, month - 1, day));\n\n return (\n date.getUTCFullYear() === year &&\n date.getUTCMonth() === month - 1 &&\n date.getUTCDate() === day\n );\n};\n\n// `'https'` and `'https:'` both name the scheme `URL.protocol` reports as\n// `'https:'`.\nconst normalizeProtocol = (protocol: string) =>\n `${protocol.toLowerCase().replace(/:$/, '')}:`;\n\nconst invalid = (message: string): ValidationResult => ({\n valid: false,\n message,\n});\n\nexport const validateBindingValue = (\n binding: BindingItem,\n value: unknown,\n options: ValidationOptions = {},\n): ValidationResult => {\n const messages = { ...defaultValidationMessages, ...options.messages };\n const isEmpty = value === '' || value === null || value === undefined;\n\n if (isEmpty) {\n if (binding.required) {\n return { valid: false, message: messages.required };\n }\n return VALID;\n }\n\n // `min` and `max` apply to numbers only; a `type: 'number'` field passes\n // a number (#238). Other values aren't range-checked.\n if (typeof value === 'number') {\n if (binding.min !== undefined && value < binding.min) {\n return { valid: false, message: messages.min(binding.min) };\n }\n if (binding.max !== undefined && value > binding.max) {\n return { valid: false, message: messages.max(binding.max) };\n }\n\n if (binding.step !== undefined && binding.step > 0) {\n const steps = (value - (binding.min ?? 0)) / binding.step;\n\n if (Math.abs(steps - Math.round(steps)) > STEP_TOLERANCE) {\n return invalid(messages.step(binding.step));\n }\n }\n }\n\n if (typeof value === 'string') {\n const length = [...value].length;\n\n if (binding.minLength !== undefined && length < binding.minLength) {\n return invalid(messages.minLength(binding.minLength));\n }\n\n if (binding.maxLength !== undefined && length > binding.maxLength) {\n return invalid(messages.maxLength(binding.maxLength));\n }\n }\n\n if (Array.isArray(value)) {\n if (binding.minItems !== undefined && value.length < binding.minItems) {\n return invalid(messages.minItems(binding.minItems));\n }\n\n if (binding.maxItems !== undefined && value.length > binding.maxItems) {\n return invalid(messages.maxItems(binding.maxItems));\n }\n }\n\n if (typeof value === 'string' && binding.pattern) {\n let regex: RegExp;\n\n try {\n regex = new RegExp(binding.pattern);\n } catch {\n // An invalid `pattern` is the binding's mistake, so don't block the\n // input.\n return VALID;\n }\n\n if (!regex.test(value)) {\n return invalid(binding.patternMessage ?? messages.pattern);\n }\n }\n\n if (typeof value === 'string' && binding.type === 'url') {\n let url: URL;\n\n try {\n url = new URL(value);\n } catch {\n return { valid: false, message: messages.url };\n }\n\n if (binding.protocols?.length) {\n const allowed = binding.protocols.map(normalizeProtocol);\n\n if (!allowed.includes(url.protocol)) {\n return invalid(messages.protocol(allowed));\n }\n }\n }\n\n if (typeof value === 'string' && binding.type === 'time') {\n if (!TIME.test(value)) {\n return invalid(messages.time);\n }\n }\n\n if (\n typeof value === 'string' &&\n (binding.type === 'date' || binding.type === 'datetime')\n ) {\n if (binding.type === 'date' && !isCalendarDate(value)) {\n return invalid(messages.date);\n }\n\n if (binding.type === 'datetime' && !isDateTime(value)) {\n return invalid(messages.datetime);\n }\n\n if (\n binding.minDate !== undefined &&\n compareToBound(value, binding.minDate) < 0\n ) {\n return invalid(messages.minDate(binding.minDate));\n }\n\n if (\n binding.maxDate !== undefined &&\n compareToBound(value, binding.maxDate) > 0\n ) {\n return invalid(messages.maxDate(binding.maxDate));\n }\n }\n\n if (\n typeof value === 'string' &&\n binding.type === 'email' &&\n !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Q,SAAS,aAC7C;EACA,IAAI,QAAQ,SAAS,UAAU,CAAC,eAAe,KAAK,GAClD,OAAO,QAAQ,SAAS,IAAI;EAG9B,IAAI,QAAQ,SAAS,cAAc,CAAC,WAAW,KAAK,GAClD,OAAO,QAAQ,SAAS,QAAQ;EAGlC,IACE,QAAQ,YAAY,KAAA,KACpB,eAAe,OAAO,QAAQ,OAAO,IAAI,GAEzC,OAAO,QAAQ,SAAS,QAAQ,QAAQ,OAAO,CAAC;EAGlD,IACE,QAAQ,YAAY,KAAA,KACpB,eAAe,OAAO,QAAQ,OAAO,IAAI,GAEzC,OAAO,QAAQ,SAAS,QAAQ,QAAQ,OAAO,CAAC;CAEpD;CAEA,IACE,OAAO,UAAU,YACjB,QAAQ,SAAS,WACjB,CAAC,MAAM,KAAK,KAAK,GAEjB,OAAO,QAAQ,SAAS,KAAK;CAG/B,OAAO;AACT"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { r as BindingItem } from "./types-Czps1Txy.js";
|
|
2
|
+
//#region src/utils/ast/validate.d.ts
|
|
3
|
+
interface ValidationResult {
|
|
4
|
+
valid: boolean;
|
|
5
|
+
message?: string;
|
|
6
|
+
}
|
|
7
|
+
interface ValidationMessages {
|
|
8
|
+
required: string;
|
|
9
|
+
min: (min: number) => string;
|
|
10
|
+
max: (max: number) => string;
|
|
11
|
+
pattern: string;
|
|
12
|
+
url: string;
|
|
13
|
+
date: string;
|
|
14
|
+
time: string;
|
|
15
|
+
datetime: string;
|
|
16
|
+
email: string;
|
|
17
|
+
minLength: (minLength: number) => string;
|
|
18
|
+
maxLength: (maxLength: number) => string;
|
|
19
|
+
step: (step: number) => string;
|
|
20
|
+
minItems: (minItems: number) => string;
|
|
21
|
+
maxItems: (maxItems: number) => string;
|
|
22
|
+
minDate: (minDate: string) => string;
|
|
23
|
+
maxDate: (maxDate: string) => string;
|
|
24
|
+
protocol: (protocols: string[]) => string;
|
|
25
|
+
}
|
|
26
|
+
declare const defaultValidationMessages: ValidationMessages;
|
|
27
|
+
interface ValidationOptions {
|
|
28
|
+
messages?: Partial<ValidationMessages>;
|
|
29
|
+
}
|
|
30
|
+
declare const validateBindingValue: (binding: BindingItem, value: unknown, options?: ValidationOptions) => ValidationResult;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { validateBindingValue as a, defaultValidationMessages as i, ValidationOptions as n, ValidationResult as r, ValidationMessages as t };
|
|
33
|
+
//# sourceMappingURL=validate-CiA1LF6S.d.ts.map
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "
|
|
7
|
+
"version": "5.0.0",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"module": "./dist/index.js",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"url": "https://github.com/pjb0811/live-editor/issues"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
|
-
"node": ">=
|
|
41
|
+
"node": "^22.18.0 || >=24.11.0"
|
|
42
42
|
},
|
|
43
43
|
"packageManager": "pnpm@12.8.1",
|
|
44
44
|
"exports": {
|
|
@@ -92,9 +92,10 @@
|
|
|
92
92
|
"check-api-surface": "node .github/scripts/check-api-surface.mjs",
|
|
93
93
|
"check-package-types": "pnpm build && node .github/scripts/check-package-types.mjs",
|
|
94
94
|
"lint": "eslint .",
|
|
95
|
-
"
|
|
95
|
+
"knip": "knip",
|
|
96
96
|
"test": "vitest run",
|
|
97
97
|
"test:browser": "playwright test",
|
|
98
|
+
"test:coverage": "vitest run --coverage",
|
|
98
99
|
"test:watch": "vitest",
|
|
99
100
|
"bench": "vitest bench",
|
|
100
101
|
"preview": "vite preview",
|
|
@@ -102,15 +103,15 @@
|
|
|
102
103
|
"prepare": "husky"
|
|
103
104
|
},
|
|
104
105
|
"dependencies": {
|
|
105
|
-
"@babel/standalone": "^
|
|
106
|
+
"@babel/standalone": "^8.0.6",
|
|
106
107
|
"@codemirror/lang-javascript": "^6.2.5",
|
|
107
108
|
"@codemirror/merge": "^6.12.2",
|
|
108
109
|
"@dnd-kit/core": "^6.3.1",
|
|
109
110
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
110
111
|
"@dnd-kit/sortable": "^10.0.0",
|
|
111
112
|
"@dnd-kit/utilities": "^3.2.2",
|
|
112
|
-
"@jbpark/ui-kit": "^10.0
|
|
113
|
-
"@jbpark/use-hooks": "^4.
|
|
113
|
+
"@jbpark/ui-kit": "^10.3.0",
|
|
114
|
+
"@jbpark/use-hooks": "^4.6.0",
|
|
114
115
|
"@uiw/codemirror-theme-vscode": "^4.25.11",
|
|
115
116
|
"@uiw/react-codemirror": "^4.25.11",
|
|
116
117
|
"codemirror": "^6.0.0",
|
|
@@ -129,10 +130,10 @@
|
|
|
129
130
|
}
|
|
130
131
|
},
|
|
131
132
|
"devDependencies": {
|
|
132
|
-
"@babel/generator": "^
|
|
133
|
-
"@babel/parser": "^
|
|
134
|
-
"@babel/traverse": "^
|
|
135
|
-
"@babel/types": "^
|
|
133
|
+
"@babel/generator": "^8.0.6",
|
|
134
|
+
"@babel/parser": "^8.0.6",
|
|
135
|
+
"@babel/traverse": "^8.0.6",
|
|
136
|
+
"@babel/types": "^8.0.6",
|
|
136
137
|
"@changesets/cli": "^3.0.0",
|
|
137
138
|
"@eslint/js": "^10.0.0",
|
|
138
139
|
"@playwright/test": "^1.63.0",
|
|
@@ -141,22 +142,20 @@
|
|
|
141
142
|
"@testing-library/react": "^16.3.3",
|
|
142
143
|
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
|
143
144
|
"@tsdown/css": "^0.22.14",
|
|
144
|
-
"@types/babel__generator": "^7.27.0",
|
|
145
|
-
"@types/babel__standalone": "^7.1.9",
|
|
146
|
-
"@types/babel__traverse": "^7.28.0",
|
|
147
145
|
"@types/node": "^26.2.0",
|
|
148
146
|
"@types/react": "^19.2.18",
|
|
149
147
|
"@types/react-dom": "^19.2.4",
|
|
150
148
|
"@vitejs/plugin-react": "^6.0.5",
|
|
149
|
+
"@vitest/coverage-v8": "^5.0.3",
|
|
151
150
|
"baseline-browser-mapping": "^2.11.14",
|
|
152
151
|
"clsx": "^2.1.1",
|
|
153
|
-
"depcheck": "^1.4.7",
|
|
154
152
|
"eslint": "^10.0.0",
|
|
155
153
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
156
154
|
"eslint-plugin-react-refresh": "^0.5.4",
|
|
157
155
|
"globals": "^17.11.0",
|
|
158
156
|
"husky": "^9.1.7",
|
|
159
157
|
"jsdom": "^30.0.1",
|
|
158
|
+
"knip": "^5.88.1",
|
|
160
159
|
"lint-staged": "^17.3.0",
|
|
161
160
|
"nanoid": "^6.0.0",
|
|
162
161
|
"prettier": "^3.9.6",
|
|
@@ -170,7 +169,6 @@
|
|
|
170
169
|
"typescript": "~6.0.3",
|
|
171
170
|
"typescript-eslint": "^8.67.0",
|
|
172
171
|
"vite": "^8.2.1",
|
|
173
|
-
"vite-plugin-dts": "^5.0.3",
|
|
174
172
|
"vitest": "^5.0.0"
|
|
175
173
|
},
|
|
176
174
|
"lint-staged": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compile-Dxas-D05.js","names":[],"sources":["../src/utils/scripts.ts","../src/utils/compile.ts"],"sourcesContent":["import { CONFIG } from '../constants';\nimport { createBoundedCache } from './cache';\nimport { registerEditorCache } from './editor-caches';\n\n// How many callers have requested each script and not yet injected it. A\n// blob URL evicted in that time isn't revoked until the last of them is done\n// (`deferredRevocations`), or its `<script>` would fail to load without an\n// error (#443).\nconst pins = new Map<string, number>();\nconst deferredRevocations = new Map<string, string[]>();\n\nconst revoke = (src: string, blobUrl: string) => {\n if (!pins.has(src)) {\n URL.revokeObjectURL(blobUrl);\n return;\n }\n\n deferredRevocations.set(src, [\n ...(deferredRevocations.get(src) ?? []),\n blobUrl,\n ]);\n};\n\nconst pin = (src: string) => {\n pins.set(src, (pins.get(src) ?? 0) + 1);\n};\n\nconst unpin = (src: string) => {\n const count = (pins.get(src) ?? 0) - 1;\n\n if (count > 0) {\n pins.set(src, count);\n return;\n }\n\n pins.delete(src);\n deferredRevocations.get(src)?.forEach(blobUrl => {\n URL.revokeObjectURL(blobUrl);\n });\n deferredRevocations.delete(src);\n};\n\nconst scriptCache = createBoundedCache<string, string>(\n CONFIG.SCRIPT_CACHE_LIMIT,\n revoke,\n);\nconst loadingScriptCache = new Map<string, Promise<string>>();\n\nexport const getCachedScriptBlob = async (src: string): Promise<string> => {\n const cached = scriptCache.get(src);\n\n if (cached) {\n return cached;\n }\n\n const existing = loadingScriptCache.get(src);\n\n if (existing) {\n return existing;\n }\n\n const promise = fetch(src)\n .then(res => res.text())\n .then(text => {\n const blob = new Blob([text], { type: 'application/javascript' });\n const blobUrl = URL.createObjectURL(blob);\n\n scriptCache.set(src, blobUrl);\n\n return blobUrl;\n })\n // Clean up after a failure too: a rejected promise left here would be\n // reused by every later caller, so the script could never load again.\n .finally(() => {\n loadingScriptCache.delete(src);\n });\n\n loadingScriptCache.set(src, promise);\n\n return promise;\n};\n\n// Resolves every script to a blob URL and hands them to `inject` while none\n// of them can be revoked. `inject` must use them at once, as appending\n// `<script>` elements does: the browser resolves a blob URL on insertion.\n// Several scripts, or several frames, can push more scripts through the cache\n// than it holds before the last one arrives (#443).\nexport const withScriptBlobs = async (\n scripts: string[],\n inject: (blobUrls: string[]) => void,\n): Promise<void> => {\n scripts.forEach(pin);\n\n try {\n inject(await Promise.all(scripts.map(getCachedScriptBlob)));\n } finally {\n scripts.forEach(unpin);\n }\n};\n\nexport const preloadScripts = (scripts: string[]): void => {\n scripts.forEach(src => {\n // Not awaited, so the rejection is handled here. The real load reports a\n // failure to whoever awaits it.\n getCachedScriptBlob(src).catch(() => {});\n });\n};\n\n// Revokes every blob URL, through the same `onEvict` the LRU uses, and drops\n// the pending loads, so the next session doesn't get a URL created before\n// the revocation.\nexport const clearScriptCache = () => {\n scriptCache.clear();\n loadingScriptCache.clear();\n};\n\nregisterEditorCache(clearScriptCache);\n","import React from 'react';\n\nimport * as Babel from '@babel/standalone';\n\nimport type { Module } from '~/types';\n\nimport { CONFIG } from '../constants';\nimport { createBoundedCache } from './cache';\nimport { detectTypeScript } from './detect-typescript';\nimport { registerEditorCache } from './editor-caches';\n\ninterface CompilationKey {\n code: string;\n modules: [string, unknown][];\n}\n\n// The keys still in the LRU. Comparing at most `CACHE_LIMIT` of them avoids\n// keeping every module object ever seen, or serializing modules, which can be\n// cyclic or closures.\nconst compilationKeys = new Set<CompilationKey>();\nconst compilationCache = createBoundedCache<CompilationKey, Module>(\n CONFIG.CACHE_LIMIT,\n key => compilationKeys.delete(key),\n);\n\nconst createCacheKey = (\n code: string,\n modules: Record<string, unknown>,\n): CompilationKey => ({\n code,\n modules: Object.keys(modules)\n .sort()\n .map(name => [name, modules[name]]),\n});\n\n// Objects/functions compare by reference; primitives compare by value.\n// Replace a module object when its implementation changes. In-place edits\n// inside an existing module are intentionally not observed by this cache.\nexport const compile = (\n code: string,\n modules: Record<string, unknown>,\n): Module => {\n const candidate = createCacheKey(code, modules);\n\n for (const key of compilationKeys) {\n if (\n key.code === candidate.code &&\n key.modules.length === candidate.modules.length &&\n key.modules.every(\n ([name, value], index) =>\n name === candidate.modules[index]![0] &&\n Object.is(value, candidate.modules[index]![1]),\n )\n ) {\n return compilationCache.get(key)!;\n }\n }\n\n const result = compileModule(code, Object.fromEntries(candidate.modules));\n\n compilationCache.set(candidate, result);\n compilationKeys.add(candidate);\n\n return result;\n};\n\n// `compilationKeys` needs no separate pass: it is drained by the `onEvict`\n// the cache was built with, which `clear()` runs for every entry.\nexport const clearCompilationCache = () => {\n compilationCache.clear();\n};\n\n// Transforms JSX and TypeScript with `@babel/standalone`'s presets, without\n// the `typescript` package (#192). Babel works per file without types, so a\n// `const enum` becomes a real enum and legacy decorators aren't supported.\n// On an error, the input comes back unchanged.\nexport const transformCode = (code: string, isTypeScript = false): string => {\n try {\n const result = Babel.transform(code, {\n filename: isTypeScript ? 'preview.tsx' : 'preview.jsx',\n presets: isTypeScript ? ['typescript', 'env', 'react'] : ['env', 'react'],\n sourceType: 'module',\n plugins: [Babel.availablePlugins['transform-modules-commonjs']],\n }).code;\n\n return result || '';\n } catch (e) {\n console.error('❌ Babel transformation error:', e);\n return code;\n }\n};\n\nconst compileModule = (\n code: string,\n modules: Record<string, unknown>,\n): Module => {\n const isTypeScript = detectTypeScript(code);\n\n type RenderFunction = (\n exports: Module['exports'],\n require: (name: string) => unknown,\n module: Module,\n React: typeof import('react'),\n ) => void;\n\n let render: RenderFunction;\n\n // Runs in this window's own JS realm, not inside the preview iframe — the iframe only\n // renders the resulting React elements via portal. See README \"Security Notes\".\n try {\n render = new Function(\n 'exports',\n 'require',\n 'module',\n 'React',\n transformCode(code, isTypeScript),\n ) as RenderFunction;\n } catch (e) {\n const errorMessage = e instanceof Error ? e.message : 'Syntax error';\n return { exports: {}, error: errorMessage };\n }\n\n const module: Module = { exports: {} };\n\n const customRequire = (name: string) => {\n if (name === 'react') {\n return React;\n }\n\n // Check presence, not truthiness: a module can be a falsy value (`0`, `''`,\n // `false`, `null`).\n if (name in modules) {\n return modules[name];\n }\n\n throw new Error(`Module not found: ${name}`);\n };\n\n try {\n render(module.exports, customRequire, module, React);\n } catch (e) {\n const errorMessage = e instanceof Error ? e.message : 'Runtime error';\n return { exports: {}, error: errorMessage };\n }\n\n return module;\n};\n\nregisterEditorCache(clearCompilationCache);\n"],"mappings":";;;;;;;AAQA,MAAM,uBAAO,IAAI,IAAoB;AACrC,MAAM,sCAAsB,IAAI,IAAsB;AAEtD,MAAM,UAAU,KAAa,YAAoB;CAC/C,IAAI,CAAC,KAAK,IAAI,GAAG,GAAG;EAClB,IAAI,gBAAgB,OAAO;EAC3B;CACF;CAEA,oBAAoB,IAAI,KAAK,CAC3B,GAAI,oBAAoB,IAAI,GAAG,KAAK,CAAC,GACrC,OACF,CAAC;AACH;AAEA,MAAM,OAAO,Q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