@hyperfixi/behaviors 2.0.0 → 2.1.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/all.browser.global.js +35 -6
- package/dist/all.browser.global.js.map +1 -1
- package/dist/autodismiss.browser.global.js +3 -0
- package/dist/autodismiss.browser.global.js.map +1 -0
- package/dist/behaviors/autodismiss.cjs +177 -0
- package/dist/behaviors/autodismiss.cjs.map +1 -0
- package/dist/behaviors/autodismiss.d.cts +15 -0
- package/dist/behaviors/autodismiss.d.ts +15 -0
- package/dist/behaviors/autodismiss.js +15 -0
- package/dist/behaviors/autodismiss.js.map +1 -0
- package/dist/behaviors/clickoutside.cjs +123 -0
- package/dist/behaviors/clickoutside.cjs.map +1 -0
- package/dist/behaviors/clickoutside.d.cts +15 -0
- package/dist/behaviors/clickoutside.d.ts +15 -0
- package/dist/behaviors/clickoutside.js +15 -0
- package/dist/behaviors/clickoutside.js.map +1 -0
- package/dist/behaviors/clipboard.cjs +193 -0
- package/dist/behaviors/clipboard.cjs.map +1 -0
- package/dist/behaviors/clipboard.d.cts +15 -0
- package/dist/behaviors/clipboard.d.ts +15 -0
- package/dist/behaviors/clipboard.js +15 -0
- package/dist/behaviors/clipboard.js.map +1 -0
- package/dist/behaviors/draggable.cjs +49 -7
- package/dist/behaviors/draggable.cjs.map +1 -1
- package/dist/behaviors/draggable.d.cts +2 -1
- package/dist/behaviors/draggable.d.ts +2 -1
- package/dist/behaviors/draggable.js +2 -1
- package/dist/behaviors/focustrap.cjs +191 -0
- package/dist/behaviors/focustrap.cjs.map +1 -0
- package/dist/behaviors/focustrap.d.cts +15 -0
- package/dist/behaviors/focustrap.d.ts +15 -0
- package/dist/behaviors/focustrap.js +15 -0
- package/dist/behaviors/focustrap.js.map +1 -0
- package/dist/behaviors/removable.cjs +9 -2
- package/dist/behaviors/removable.cjs.map +1 -1
- package/dist/behaviors/removable.d.cts +1 -1
- package/dist/behaviors/removable.d.ts +1 -1
- package/dist/behaviors/removable.js +2 -1
- package/dist/behaviors/resizable.cjs +54 -7
- package/dist/behaviors/resizable.cjs.map +1 -1
- package/dist/behaviors/resizable.d.cts +1 -1
- package/dist/behaviors/resizable.d.ts +1 -1
- package/dist/behaviors/resizable.js +2 -1
- package/dist/behaviors/scrollreveal.cjs +149 -0
- package/dist/behaviors/scrollreveal.cjs.map +1 -0
- package/dist/behaviors/scrollreveal.d.cts +15 -0
- package/dist/behaviors/scrollreveal.d.ts +15 -0
- package/dist/behaviors/scrollreveal.js +15 -0
- package/dist/behaviors/scrollreveal.js.map +1 -0
- package/dist/behaviors/sortable.cjs +49 -7
- package/dist/behaviors/sortable.cjs.map +1 -1
- package/dist/behaviors/sortable.d.cts +1 -1
- package/dist/behaviors/sortable.d.ts +1 -1
- package/dist/behaviors/sortable.js +2 -1
- package/dist/behaviors/tabs.cjs +247 -0
- package/dist/behaviors/tabs.cjs.map +1 -0
- package/dist/behaviors/tabs.d.cts +15 -0
- package/dist/behaviors/tabs.d.ts +15 -0
- package/dist/behaviors/tabs.js +15 -0
- package/dist/behaviors/tabs.js.map +1 -0
- package/dist/behaviors/toggleable.cjs +36 -7
- package/dist/behaviors/toggleable.cjs.map +1 -1
- package/dist/behaviors/toggleable.d.cts +2 -1
- package/dist/behaviors/toggleable.d.ts +2 -1
- package/dist/behaviors/toggleable.js +2 -1
- package/dist/chunk-244WSZOL.js +67 -0
- package/dist/chunk-244WSZOL.js.map +1 -0
- package/dist/chunk-2NSKQMNM.js +99 -0
- package/dist/chunk-2NSKQMNM.js.map +1 -0
- package/dist/chunk-64DIQGQI.js +37 -0
- package/dist/chunk-64DIQGQI.js.map +1 -0
- package/dist/chunk-6TJXDCAQ.js +11 -0
- package/dist/chunk-6TJXDCAQ.js.map +1 -0
- package/dist/chunk-7JDV2THA.js +62 -0
- package/dist/chunk-7JDV2THA.js.map +1 -0
- package/dist/chunk-AFGA54SA.js +116 -0
- package/dist/chunk-AFGA54SA.js.map +1 -0
- package/dist/chunk-DYHBKDKB.js +62 -0
- package/dist/chunk-DYHBKDKB.js.map +1 -0
- package/dist/chunk-GPTHAUWN.js +58 -0
- package/dist/chunk-GPTHAUWN.js.map +1 -0
- package/dist/chunk-GVJPA2EK.js +68 -0
- package/dist/chunk-GVJPA2EK.js.map +1 -0
- package/dist/chunk-H2MCHR5A.js +89 -0
- package/dist/chunk-H2MCHR5A.js.map +1 -0
- package/dist/{chunk-2NQHIHD5.js → chunk-H5Y5ARYG.js} +6 -3
- package/dist/chunk-H5Y5ARYG.js.map +1 -0
- package/dist/chunk-JKBWIJFI.js +155 -0
- package/dist/chunk-JKBWIJFI.js.map +1 -0
- package/dist/chunk-QKDYW4VM.js +70 -0
- package/dist/chunk-QKDYW4VM.js.map +1 -0
- package/dist/chunk-RB7OB6OD.js +51 -0
- package/dist/chunk-RB7OB6OD.js.map +1 -0
- package/dist/chunk-RPERQTFU.js +75 -0
- package/dist/chunk-RPERQTFU.js.map +1 -0
- package/dist/chunk-S4QDV2MH.js +75 -0
- package/dist/chunk-S4QDV2MH.js.map +1 -0
- package/dist/chunk-WTUVPVSD.js +80 -0
- package/dist/chunk-WTUVPVSD.js.map +1 -0
- package/dist/chunk-YHQRFUWV.js +62 -0
- package/dist/chunk-YHQRFUWV.js.map +1 -0
- package/dist/chunk-ZQQZTMCJ.js +64 -0
- package/dist/chunk-ZQQZTMCJ.js.map +1 -0
- package/dist/clickoutside.browser.global.js +12 -0
- package/dist/clickoutside.browser.global.js.map +1 -0
- package/dist/clipboard.browser.global.js +3 -0
- package/dist/clipboard.browser.global.js.map +1 -0
- package/dist/core.browser.global.js +3 -3
- package/dist/core.browser.global.js.map +1 -1
- package/dist/draggable.browser.global.js +2 -2
- package/dist/draggable.browser.global.js.map +1 -1
- package/dist/focustrap.browser.global.js +9 -0
- package/dist/focustrap.browser.global.js.map +1 -0
- package/dist/index.cjs +1270 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -7
- package/dist/index.d.ts +13 -7
- package/dist/index.js +155 -48
- package/dist/index.js.map +1 -1
- package/dist/loaders.cjs +1151 -30
- package/dist/loaders.cjs.map +1 -1
- package/dist/loaders.js +9 -3
- package/dist/registry.d.cts +1 -1
- package/dist/registry.d.ts +1 -1
- package/dist/removable.browser.global.js +2 -2
- package/dist/removable.browser.global.js.map +1 -1
- package/dist/resizable.browser.global.js +2 -2
- package/dist/resizable.browser.global.js.map +1 -1
- package/dist/schemas/index.cjs +343 -1
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +45 -3
- package/dist/schemas/index.d.ts +45 -3
- package/dist/schemas/index.js +34 -4
- package/dist/schemas/index.js.map +1 -1
- package/dist/scrollreveal.browser.global.js +11 -0
- package/dist/scrollreveal.browser.global.js.map +1 -0
- package/dist/sortable.browser.global.js +2 -2
- package/dist/sortable.browser.global.js.map +1 -1
- package/dist/tabs.browser.global.js +3 -0
- package/dist/tabs.browser.global.js.map +1 -0
- package/dist/toggleable.browser.global.js +2 -2
- package/dist/toggleable.browser.global.js.map +1 -1
- package/dist/{types-CCc_2wAb.d.cts → types-DCCtVQS5.d.cts} +1 -1
- package/dist/{types-CCc_2wAb.d.ts → types-DCCtVQS5.d.ts} +1 -1
- package/package.json +45 -2
- package/src/behaviors/autodismiss.test.ts +61 -0
- package/src/behaviors/autodismiss.ts +107 -0
- package/src/behaviors/clickoutside.test.ts +52 -0
- package/src/behaviors/clickoutside.ts +77 -0
- package/src/behaviors/clipboard.test.ts +67 -0
- package/src/behaviors/clipboard.ts +130 -0
- package/src/behaviors/draggable.ts +62 -15
- package/src/behaviors/focustrap.test.ts +59 -0
- package/src/behaviors/focustrap.ts +158 -0
- package/src/behaviors/index.ts +37 -0
- package/src/behaviors/integration.test.ts +120 -45
- package/src/behaviors/removable.ts +4 -5
- package/src/behaviors/resizable.ts +63 -14
- package/src/behaviors/scrollreveal.test.ts +59 -0
- package/src/behaviors/scrollreveal.ts +78 -0
- package/src/behaviors/sortable.ts +61 -14
- package/src/behaviors/tabs.test.ts +81 -0
- package/src/behaviors/tabs.ts +196 -0
- package/src/behaviors/toggleable.ts +45 -13
- package/src/generated/metadata.ts +38 -7
- package/src/generated/types.ts +5 -5
- package/src/index.test.ts +143 -5
- package/src/index.ts +65 -13
- package/src/loaders.ts +18 -0
- package/src/registry.test.ts +26 -5
- package/src/schemas/autodismiss.schema.ts +66 -0
- package/src/schemas/clickoutside.schema.ts +39 -0
- package/src/schemas/clipboard.schema.ts +72 -0
- package/src/schemas/focustrap.schema.ts +53 -0
- package/src/schemas/index.ts +18 -0
- package/src/schemas/scrollreveal.schema.ts +60 -0
- package/src/schemas/tabs.schema.ts +66 -0
- package/src/schemas/types.ts +13 -1
- package/dist/chunk-2NQHIHD5.js.map +0 -1
- package/dist/chunk-3Q652JQB.js +0 -37
- package/dist/chunk-3Q652JQB.js.map +0 -1
- package/dist/chunk-HMRPQWQU.js +0 -37
- package/dist/chunk-HMRPQWQU.js.map +0 -1
- package/dist/chunk-MEP6B7XW.js +0 -37
- package/dist/chunk-MEP6B7XW.js.map +0 -1
- package/dist/chunk-URBOGGW6.js +0 -32
- package/dist/chunk-URBOGGW6.js.map +0 -1
- package/dist/chunk-WU37DFAL.js +0 -37
- package/dist/chunk-WU37DFAL.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/behaviors/toggleable.ts"],"sourcesContent":["/**\n * Toggleable Behavior\n *\n * A behavior that toggles a CSS class on click.\n * Useful for accordions, dropdowns, and toggle buttons.\n *\n * @example\n * ```html\n * <button _=\"install Toggleable\">Toggle</button>\n *\n * <button _=\"install Toggleable(cls: expanded, target: #menu)\">Menu</button>\n * ```\n */\n\nimport { toggleableSchema } from '../schemas/toggleable.schema';\nimport type { LokaScriptInstance, LokaScriptWindow } from '../schemas/types';\n\n// Re-export schema-derived values for backwards compatibility\nexport const toggleableSource = toggleableSchema.source;\nexport const toggleableMetadata = toggleableSchema;\n\n/**\n * Register the Toggleable behavior with LokaScript.\n */\nexport async function registerToggleable(hyperfixi?: LokaScriptInstance): Promise<void> {\n const hf =\n hyperfixi ||\n (typeof window !== 'undefined' ? (window as unknown as LokaScriptWindow).lokascript : null);\n\n if (!hf) {\n throw new Error(\n 'LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors.'\n );\n }\n\n const result = hf.compileSync(toggleableSchema.source, { traditional: true });\n\n if (!result.ok) {\n throw new Error(`Failed to compile Toggleable behavior: ${JSON.stringify(result.errors)}`);\n }\n\n const ctx = hf.createContext ? hf.createContext() : { locals: new Map(), globals: new Map() };\n await hf.execute(result.ast, ctx);\n}\n\n// Auto-register when loaded as a script tag\nif (typeof window !== 'undefined' && (window as unknown as LokaScriptWindow).lokascript) {\n registerToggleable().catch(console.error);\n}\n\nexport default {\n source: toggleableSchema.source,\n metadata: toggleableSchema,\n register: registerToggleable,\n};\n"],"mappings":";;;;;AAkBO,IAAM,mBAAmB,iBAAiB;AAC1C,IAAM,qBAAqB;AAKlC,eAAsB,mBAAmB,WAA+C;AACtF,QAAM,KACJ,cACC,OAAO,WAAW,cAAe,OAAuC,aAAa;AAExF,MAAI,CAAC,IAAI;AACP,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,SAAS,GAAG,YAAY,iBAAiB,QAAQ,EAAE,aAAa,KAAK,CAAC;AAE5E,MAAI,CAAC,OAAO,IAAI;AACd,UAAM,IAAI,MAAM,0CAA0C,KAAK,UAAU,OAAO,MAAM,CAAC,EAAE;AAAA,EAC3F;AAEA,QAAM,MAAM,GAAG,gBAAgB,GAAG,cAAc,IAAI,EAAE,QAAQ,oBAAI,IAAI,GAAG,SAAS,oBAAI,IAAI,EAAE;AAC5F,QAAM,GAAG,QAAQ,OAAO,KAAK,GAAG;AAClC;AAGA,IAAI,OAAO,WAAW,eAAgB,OAAuC,YAAY;AACvF,qBAAmB,EAAE,MAAM,QAAQ,KAAK;AAC1C;AAEA,IAAO,qBAAQ;AAAA,EACb,QAAQ,iBAAiB;AAAA,EACzB,UAAU;AAAA,EACV,UAAU;AACZ;","names":[]}
|
package/dist/chunk-HMRPQWQU.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resizableSchema
|
|
3
|
-
} from "./chunk-V5IWDPDP.js";
|
|
4
|
-
|
|
5
|
-
// src/behaviors/resizable.ts
|
|
6
|
-
var resizableSource = resizableSchema.source;
|
|
7
|
-
var resizableMetadata = resizableSchema;
|
|
8
|
-
async function registerResizable(hyperfixi) {
|
|
9
|
-
const hf = hyperfixi || (typeof window !== "undefined" ? window.lokascript : null);
|
|
10
|
-
if (!hf) {
|
|
11
|
-
throw new Error(
|
|
12
|
-
"LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors."
|
|
13
|
-
);
|
|
14
|
-
}
|
|
15
|
-
const result = hf.compileSync(resizableSchema.source, { traditional: true });
|
|
16
|
-
if (!result.ok) {
|
|
17
|
-
throw new Error(`Failed to compile Resizable behavior: ${JSON.stringify(result.errors)}`);
|
|
18
|
-
}
|
|
19
|
-
const ctx = hf.createContext ? hf.createContext() : { locals: /* @__PURE__ */ new Map(), globals: /* @__PURE__ */ new Map() };
|
|
20
|
-
await hf.execute(result.ast, ctx);
|
|
21
|
-
}
|
|
22
|
-
if (typeof window !== "undefined" && window.lokascript) {
|
|
23
|
-
registerResizable().catch(console.error);
|
|
24
|
-
}
|
|
25
|
-
var resizable_default = {
|
|
26
|
-
source: resizableSchema.source,
|
|
27
|
-
metadata: resizableSchema,
|
|
28
|
-
register: registerResizable
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export {
|
|
32
|
-
resizableSource,
|
|
33
|
-
resizableMetadata,
|
|
34
|
-
registerResizable,
|
|
35
|
-
resizable_default
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=chunk-HMRPQWQU.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/behaviors/resizable.ts"],"sourcesContent":["/**\n * Resizable Behavior\n *\n * A behavior that makes elements resizable by dragging edges or corners.\n * Supports minimum/maximum dimensions and resize handles.\n *\n * @example\n * ```html\n * <div _=\"install Resizable\" style=\"width: 200px; height: 150px;\">\n * Resize me!\n * </div>\n * ```\n */\n\nimport { resizableSchema } from '../schemas/resizable.schema';\nimport type { LokaScriptInstance, LokaScriptWindow } from '../schemas/types';\n\n// Re-export schema-derived values for backwards compatibility\nexport const resizableSource = resizableSchema.source;\nexport const resizableMetadata = resizableSchema;\n\n/**\n * Register the Resizable behavior with LokaScript.\n */\nexport async function registerResizable(hyperfixi?: LokaScriptInstance): Promise<void> {\n const hf =\n hyperfixi ||\n (typeof window !== 'undefined' ? (window as unknown as LokaScriptWindow).lokascript : null);\n\n if (!hf) {\n throw new Error(\n 'LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors.'\n );\n }\n\n const result = hf.compileSync(resizableSchema.source, { traditional: true });\n\n if (!result.ok) {\n throw new Error(`Failed to compile Resizable behavior: ${JSON.stringify(result.errors)}`);\n }\n\n const ctx = hf.createContext ? hf.createContext() : { locals: new Map(), globals: new Map() };\n await hf.execute(result.ast, ctx);\n}\n\n// Auto-register when loaded as a script tag\nif (typeof window !== 'undefined' && (window as unknown as LokaScriptWindow).lokascript) {\n registerResizable().catch(console.error);\n}\n\nexport default {\n source: resizableSchema.source,\n metadata: resizableSchema,\n register: registerResizable,\n};\n"],"mappings":";;;;;AAkBO,IAAM,kBAAkB,gBAAgB;AACxC,IAAM,oBAAoB;AAKjC,eAAsB,kBAAkB,WAA+C;AACrF,QAAM,KACJ,cACC,OAAO,WAAW,cAAe,OAAuC,aAAa;AAExF,MAAI,CAAC,IAAI;AACP,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,SAAS,GAAG,YAAY,gBAAgB,QAAQ,EAAE,aAAa,KAAK,CAAC;AAE3E,MAAI,CAAC,OAAO,IAAI;AACd,UAAM,IAAI,MAAM,yCAAyC,KAAK,UAAU,OAAO,MAAM,CAAC,EAAE;AAAA,EAC1F;AAEA,QAAM,MAAM,GAAG,gBAAgB,GAAG,cAAc,IAAI,EAAE,QAAQ,oBAAI,IAAI,GAAG,SAAS,oBAAI,IAAI,EAAE;AAC5F,QAAM,GAAG,QAAQ,OAAO,KAAK,GAAG;AAClC;AAGA,IAAI,OAAO,WAAW,eAAgB,OAAuC,YAAY;AACvF,oBAAkB,EAAE,MAAM,QAAQ,KAAK;AACzC;AAEA,IAAO,oBAAQ;AAAA,EACb,QAAQ,gBAAgB;AAAA,EACxB,UAAU;AAAA,EACV,UAAU;AACZ;","names":[]}
|
package/dist/chunk-MEP6B7XW.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
sortableSchema
|
|
3
|
-
} from "./chunk-BWZ6EGII.js";
|
|
4
|
-
|
|
5
|
-
// src/behaviors/sortable.ts
|
|
6
|
-
var sortableSource = sortableSchema.source;
|
|
7
|
-
var sortableMetadata = sortableSchema;
|
|
8
|
-
async function registerSortable(hyperfixi) {
|
|
9
|
-
const hf = hyperfixi || (typeof window !== "undefined" ? window.lokascript : null);
|
|
10
|
-
if (!hf) {
|
|
11
|
-
throw new Error(
|
|
12
|
-
"LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors."
|
|
13
|
-
);
|
|
14
|
-
}
|
|
15
|
-
const result = hf.compileSync(sortableSchema.source, { traditional: true });
|
|
16
|
-
if (!result.ok) {
|
|
17
|
-
throw new Error(`Failed to compile Sortable behavior: ${JSON.stringify(result.errors)}`);
|
|
18
|
-
}
|
|
19
|
-
const ctx = hf.createContext ? hf.createContext() : { locals: /* @__PURE__ */ new Map(), globals: /* @__PURE__ */ new Map() };
|
|
20
|
-
await hf.execute(result.ast, ctx);
|
|
21
|
-
}
|
|
22
|
-
if (typeof window !== "undefined" && window.lokascript) {
|
|
23
|
-
registerSortable().catch(console.error);
|
|
24
|
-
}
|
|
25
|
-
var sortable_default = {
|
|
26
|
-
source: sortableSchema.source,
|
|
27
|
-
metadata: sortableSchema,
|
|
28
|
-
register: registerSortable
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export {
|
|
32
|
-
sortableSource,
|
|
33
|
-
sortableMetadata,
|
|
34
|
-
registerSortable,
|
|
35
|
-
sortable_default
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=chunk-MEP6B7XW.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/behaviors/sortable.ts"],"sourcesContent":["/**\n * Sortable Behavior\n *\n * A behavior for drag-and-drop reordering of list items.\n * Apply to a container element; children become sortable.\n *\n * @example\n * ```html\n * <ul _=\"install Sortable\">\n * <li>Item 1</li>\n * <li>Item 2</li>\n * </ul>\n * ```\n */\n\nimport { sortableSchema } from '../schemas/sortable.schema';\nimport type { LokaScriptInstance, LokaScriptWindow } from '../schemas/types';\n\n// Re-export schema-derived values for backwards compatibility\nexport const sortableSource = sortableSchema.source;\nexport const sortableMetadata = sortableSchema;\n\n/**\n * Register the Sortable behavior with LokaScript.\n */\nexport async function registerSortable(hyperfixi?: LokaScriptInstance): Promise<void> {\n const hf =\n hyperfixi ||\n (typeof window !== 'undefined' ? (window as unknown as LokaScriptWindow).lokascript : null);\n\n if (!hf) {\n throw new Error(\n 'LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors.'\n );\n }\n\n const result = hf.compileSync(sortableSchema.source, { traditional: true });\n\n if (!result.ok) {\n throw new Error(`Failed to compile Sortable behavior: ${JSON.stringify(result.errors)}`);\n }\n\n const ctx = hf.createContext ? hf.createContext() : { locals: new Map(), globals: new Map() };\n await hf.execute(result.ast, ctx);\n}\n\n// Auto-register when loaded as a script tag\nif (typeof window !== 'undefined' && (window as unknown as LokaScriptWindow).lokascript) {\n registerSortable().catch(console.error);\n}\n\nexport default {\n source: sortableSchema.source,\n metadata: sortableSchema,\n register: registerSortable,\n};\n"],"mappings":";;;;;AAmBO,IAAM,iBAAiB,eAAe;AACtC,IAAM,mBAAmB;AAKhC,eAAsB,iBAAiB,WAA+C;AACpF,QAAM,KACJ,cACC,OAAO,WAAW,cAAe,OAAuC,aAAa;AAExF,MAAI,CAAC,IAAI;AACP,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,SAAS,GAAG,YAAY,eAAe,QAAQ,EAAE,aAAa,KAAK,CAAC;AAE1E,MAAI,CAAC,OAAO,IAAI;AACd,UAAM,IAAI,MAAM,wCAAwC,KAAK,UAAU,OAAO,MAAM,CAAC,EAAE;AAAA,EACzF;AAEA,QAAM,MAAM,GAAG,gBAAgB,GAAG,cAAc,IAAI,EAAE,QAAQ,oBAAI,IAAI,GAAG,SAAS,oBAAI,IAAI,EAAE;AAC5F,QAAM,GAAG,QAAQ,OAAO,KAAK,GAAG;AAClC;AAGA,IAAI,OAAO,WAAW,eAAgB,OAAuC,YAAY;AACvF,mBAAiB,EAAE,MAAM,QAAQ,KAAK;AACxC;AAEA,IAAO,mBAAQ;AAAA,EACb,QAAQ,eAAe;AAAA,EACvB,UAAU;AAAA,EACV,UAAU;AACZ;","names":[]}
|
package/dist/chunk-URBOGGW6.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
registerLoader,
|
|
3
|
-
registerSchema
|
|
4
|
-
} from "./chunk-3DVDS7CT.js";
|
|
5
|
-
import {
|
|
6
|
-
draggableSchema
|
|
7
|
-
} from "./chunk-G6WR2AYR.js";
|
|
8
|
-
import {
|
|
9
|
-
removableSchema
|
|
10
|
-
} from "./chunk-272NKUJ3.js";
|
|
11
|
-
import {
|
|
12
|
-
resizableSchema
|
|
13
|
-
} from "./chunk-V5IWDPDP.js";
|
|
14
|
-
import {
|
|
15
|
-
sortableSchema
|
|
16
|
-
} from "./chunk-BWZ6EGII.js";
|
|
17
|
-
import {
|
|
18
|
-
toggleableSchema
|
|
19
|
-
} from "./chunk-WUHHMDAA.js";
|
|
20
|
-
|
|
21
|
-
// src/loaders.ts
|
|
22
|
-
registerSchema(draggableSchema);
|
|
23
|
-
registerSchema(sortableSchema);
|
|
24
|
-
registerSchema(resizableSchema);
|
|
25
|
-
registerSchema(removableSchema);
|
|
26
|
-
registerSchema(toggleableSchema);
|
|
27
|
-
registerLoader("Draggable", () => import("./behaviors/draggable.js"));
|
|
28
|
-
registerLoader("Sortable", () => import("./behaviors/sortable.js"));
|
|
29
|
-
registerLoader("Resizable", () => import("./behaviors/resizable.js"));
|
|
30
|
-
registerLoader("Removable", () => import("./behaviors/removable.js"));
|
|
31
|
-
registerLoader("Toggleable", () => import("./behaviors/toggleable.js"));
|
|
32
|
-
//# sourceMappingURL=chunk-URBOGGW6.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/loaders.ts"],"sourcesContent":["/**\n * Behavior Loaders\n *\n * Registers lazy loaders for all behaviors.\n * Import this module to enable on-demand loading without bundling all behaviors.\n *\n * @example\n * ```typescript\n * // Enable lazy loading\n * import '@hyperfixi/behaviors/loaders';\n *\n * // Now load behaviors on demand\n * import { loadBehavior } from '@hyperfixi/behaviors/registry';\n * await loadBehavior('Draggable');\n * ```\n */\n\nimport { registerLoader, registerSchema } from './registry';\n\n// Register schemas for metadata queries before loading\nimport { draggableSchema } from './schemas/draggable.schema';\nimport { sortableSchema } from './schemas/sortable.schema';\nimport { resizableSchema } from './schemas/resizable.schema';\nimport { removableSchema } from './schemas/removable.schema';\nimport { toggleableSchema } from './schemas/toggleable.schema';\n\n// Register all schemas\nregisterSchema(draggableSchema);\nregisterSchema(sortableSchema);\nregisterSchema(resizableSchema);\nregisterSchema(removableSchema);\nregisterSchema(toggleableSchema);\n\n// Register lazy loaders - behaviors are only loaded when requested\nregisterLoader('Draggable', () => import('./behaviors/draggable'));\nregisterLoader('Sortable', () => import('./behaviors/sortable'));\nregisterLoader('Resizable', () => import('./behaviors/resizable'));\nregisterLoader('Removable', () => import('./behaviors/removable'));\nregisterLoader('Toggleable', () => import('./behaviors/toggleable'));\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2BA,eAAe,eAAe;AAC9B,eAAe,cAAc;AAC7B,eAAe,eAAe;AAC9B,eAAe,eAAe;AAC9B,eAAe,gBAAgB;AAG/B,eAAe,aAAa,MAAM,OAAO,0BAAuB,CAAC;AACjE,eAAe,YAAY,MAAM,OAAO,yBAAsB,CAAC;AAC/D,eAAe,aAAa,MAAM,OAAO,0BAAuB,CAAC;AACjE,eAAe,aAAa,MAAM,OAAO,0BAAuB,CAAC;AACjE,eAAe,cAAc,MAAM,OAAO,2BAAwB,CAAC;","names":[]}
|
package/dist/chunk-WU37DFAL.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
draggableSchema
|
|
3
|
-
} from "./chunk-G6WR2AYR.js";
|
|
4
|
-
|
|
5
|
-
// src/behaviors/draggable.ts
|
|
6
|
-
var draggableSource = draggableSchema.source;
|
|
7
|
-
var draggableMetadata = draggableSchema;
|
|
8
|
-
async function registerDraggable(hyperfixi) {
|
|
9
|
-
const hf = hyperfixi || (typeof window !== "undefined" ? window.lokascript : null);
|
|
10
|
-
if (!hf) {
|
|
11
|
-
throw new Error(
|
|
12
|
-
"LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors."
|
|
13
|
-
);
|
|
14
|
-
}
|
|
15
|
-
const result = hf.compileSync(draggableSchema.source, { traditional: true });
|
|
16
|
-
if (!result.ok) {
|
|
17
|
-
throw new Error(`Failed to compile Draggable behavior: ${JSON.stringify(result.errors)}`);
|
|
18
|
-
}
|
|
19
|
-
const ctx = hf.createContext ? hf.createContext() : { locals: /* @__PURE__ */ new Map(), globals: /* @__PURE__ */ new Map() };
|
|
20
|
-
await hf.execute(result.ast, ctx);
|
|
21
|
-
}
|
|
22
|
-
if (typeof window !== "undefined" && window.lokascript) {
|
|
23
|
-
registerDraggable().catch(console.error);
|
|
24
|
-
}
|
|
25
|
-
var draggable_default = {
|
|
26
|
-
source: draggableSchema.source,
|
|
27
|
-
metadata: draggableSchema,
|
|
28
|
-
register: registerDraggable
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export {
|
|
32
|
-
draggableSource,
|
|
33
|
-
draggableMetadata,
|
|
34
|
-
registerDraggable,
|
|
35
|
-
draggable_default
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=chunk-WU37DFAL.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/behaviors/draggable.ts"],"sourcesContent":["/**\n * Draggable Behavior\n *\n * A reusable behavior that makes elements draggable with pointer events.\n * Supports custom drag handles, lifecycle events, and smooth positioning.\n *\n * @example\n * ```html\n * <!-- Basic usage -->\n * <div _=\"install Draggable\">Drag me!</div>\n *\n * <!-- With custom drag handle -->\n * <div _=\"install Draggable(dragHandle: .titlebar)\">\n * <div class=\"titlebar\">Drag here</div>\n * <div class=\"content\">Content</div>\n * </div>\n * ```\n */\n\nimport { draggableSchema } from '../schemas/draggable.schema';\nimport type { LokaScriptInstance, LokaScriptWindow } from '../schemas/types';\n\n// Re-export schema-derived values for backwards compatibility\nexport const draggableSource = draggableSchema.source;\nexport const draggableMetadata = draggableSchema;\n\n/**\n * Register the Draggable behavior with LokaScript.\n */\nexport async function registerDraggable(hyperfixi?: LokaScriptInstance): Promise<void> {\n const hf =\n hyperfixi ||\n (typeof window !== 'undefined' ? (window as unknown as LokaScriptWindow).lokascript : null);\n\n if (!hf) {\n throw new Error(\n 'LokaScript not found. Make sure @hyperfixi/core is loaded before registering behaviors.'\n );\n }\n\n const result = hf.compileSync(draggableSchema.source, { traditional: true });\n\n if (!result.ok) {\n throw new Error(`Failed to compile Draggable behavior: ${JSON.stringify(result.errors)}`);\n }\n\n const ctx = hf.createContext ? hf.createContext() : { locals: new Map(), globals: new Map() };\n await hf.execute(result.ast, ctx);\n}\n\n// Auto-register when loaded as a script tag\nif (typeof window !== 'undefined' && (window as unknown as LokaScriptWindow).lokascript) {\n registerDraggable().catch(console.error);\n}\n\nexport default {\n source: draggableSchema.source,\n metadata: draggableSchema,\n register: registerDraggable,\n};\n"],"mappings":";;;;;AAuBO,IAAM,kBAAkB,gBAAgB;AACxC,IAAM,oBAAoB;AAKjC,eAAsB,kBAAkB,WAA+C;AACrF,QAAM,KACJ,cACC,OAAO,WAAW,cAAe,OAAuC,aAAa;AAExF,MAAI,CAAC,IAAI;AACP,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,SAAS,GAAG,YAAY,gBAAgB,QAAQ,EAAE,aAAa,KAAK,CAAC;AAE3E,MAAI,CAAC,OAAO,IAAI;AACd,UAAM,IAAI,MAAM,yCAAyC,KAAK,UAAU,OAAO,MAAM,CAAC,EAAE;AAAA,EAC1F;AAEA,QAAM,MAAM,GAAG,gBAAgB,GAAG,cAAc,IAAI,EAAE,QAAQ,oBAAI,IAAI,GAAG,SAAS,oBAAI,IAAI,EAAE;AAC5F,QAAM,GAAG,QAAQ,OAAO,KAAK,GAAG;AAClC;AAGA,IAAI,OAAO,WAAW,eAAgB,OAAuC,YAAY;AACvF,oBAAkB,EAAE,MAAM,QAAQ,KAAK;AACzC;AAEA,IAAO,oBAAQ;AAAA,EACb,QAAQ,gBAAgB;AAAA,EACxB,UAAU;AAAA,EACV,UAAU;AACZ;","names":[]}
|