@avento-space/ts-ui 1.1.1 → 1.2.1
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/chunk-42QSY3LJ.js +4855 -0
- package/dist/chunk-42QSY3LJ.js.map +1 -0
- package/dist/chunk-7GJXOXOW.js +108 -0
- package/dist/chunk-7GJXOXOW.js.map +1 -0
- package/dist/chunk-DO3PEBDS.js +79 -0
- package/dist/chunk-DO3PEBDS.js.map +1 -0
- package/dist/chunk-MFONNOJU.js +3 -0
- package/dist/chunk-MFONNOJU.js.map +1 -0
- package/dist/chunk-NJAZMTMT.js +5645 -0
- package/dist/chunk-NJAZMTMT.js.map +1 -0
- package/dist/chunk-PRZASPFU.js +1730 -0
- package/dist/chunk-PRZASPFU.js.map +1 -0
- package/dist/chunk-Q5RCPPCF.js +406 -0
- package/dist/chunk-Q5RCPPCF.js.map +1 -0
- package/dist/chunk-RAWESWNC.js +3 -0
- package/dist/chunk-RAWESWNC.js.map +1 -0
- package/dist/chunk-U4WYCYL6.js +116 -0
- package/dist/chunk-U4WYCYL6.js.map +1 -0
- package/dist/components/index.d.ts +13 -11
- package/dist/components/index.js +5 -5
- package/dist/components/index.js.map +1 -1
- package/dist/define.d.ts +2 -2
- package/dist/define.js +8 -1
- package/dist/define.js.map +1 -1
- package/dist/{core/element.d.ts → element-DHtonJNX.d.ts} +3 -2
- package/dist/form.wc-CwjVsdUu.d.ts +1518 -0
- package/dist/icons/index.d.ts +33 -5
- package/dist/icons/index.js +5 -3
- package/dist/icons/index.js.map +1 -1
- package/dist/index.d.ts +35 -10
- package/dist/index.js +44 -9
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.d.ts +1 -2
- package/dist/jsx-dev-runtime.js +3 -1
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx-runtime.d.ts +644 -7
- package/dist/jsx-runtime.js +3 -120
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/plugins/index.d.ts +21 -3
- package/dist/plugins/index.js +85 -1
- package/dist/plugins/index.js.map +1 -1
- package/dist/react/index.d.ts +1260 -15
- package/dist/react/index.js +1428 -15
- package/dist/react/index.js.map +1 -1
- package/dist/{core/types.d.ts → types-DWglFa91.d.ts} +8 -7
- package/package.json +32 -8
- package/dist/components/box.wc.d.ts +0 -24
- package/dist/components/box.wc.d.ts.map +0 -1
- package/dist/components/box.wc.js +0 -52
- package/dist/components/box.wc.js.map +0 -1
- package/dist/components/button.wc.d.ts +0 -32
- package/dist/components/button.wc.d.ts.map +0 -1
- package/dist/components/button.wc.js +0 -91
- package/dist/components/button.wc.js.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/input.wc.d.ts +0 -45
- package/dist/components/input.wc.d.ts.map +0 -1
- package/dist/components/input.wc.js +0 -130
- package/dist/components/input.wc.js.map +0 -1
- package/dist/components/list.wc.d.ts +0 -49
- package/dist/components/list.wc.d.ts.map +0 -1
- package/dist/components/list.wc.js +0 -120
- package/dist/components/list.wc.js.map +0 -1
- package/dist/components/portal.wc.d.ts +0 -18
- package/dist/components/portal.wc.d.ts.map +0 -1
- package/dist/components/portal.wc.js +0 -78
- package/dist/components/portal.wc.js.map +0 -1
- package/dist/components/styles.d.ts +0 -7
- package/dist/components/styles.d.ts.map +0 -1
- package/dist/components/styles.js +0 -134
- package/dist/components/styles.js.map +0 -1
- package/dist/core/define.d.ts +0 -5
- package/dist/core/define.d.ts.map +0 -1
- package/dist/core/define.js +0 -26
- package/dist/core/define.js.map +0 -1
- package/dist/core/element.d.ts.map +0 -1
- package/dist/core/element.js +0 -30
- package/dist/core/element.js.map +0 -1
- package/dist/core/index.d.ts +0 -7
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -5
- package/dist/core/index.js.map +0 -1
- package/dist/core/plugin.d.ts +0 -17
- package/dist/core/plugin.d.ts.map +0 -1
- package/dist/core/plugin.js +0 -117
- package/dist/core/plugin.js.map +0 -1
- package/dist/core/reactive-context.d.ts +0 -12
- package/dist/core/reactive-context.d.ts.map +0 -1
- package/dist/core/reactive-context.js +0 -34
- package/dist/core/reactive-context.js.map +0 -1
- package/dist/core/scheduler.d.ts +0 -13
- package/dist/core/scheduler.d.ts.map +0 -1
- package/dist/core/scheduler.js +0 -80
- package/dist/core/scheduler.js.map +0 -1
- package/dist/core/signal.d.ts +0 -14
- package/dist/core/signal.d.ts.map +0 -1
- package/dist/core/signal.js +0 -391
- package/dist/core/signal.js.map +0 -1
- package/dist/core/store.d.ts +0 -6
- package/dist/core/store.d.ts.map +0 -1
- package/dist/core/store.js +0 -35
- package/dist/core/store.js.map +0 -1
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js +0 -2
- package/dist/core/types.js.map +0 -1
- package/dist/define.d.ts.map +0 -1
- package/dist/icons/icon-element.d.ts +0 -25
- package/dist/icons/icon-element.d.ts.map +0 -1
- package/dist/icons/icon-element.js +0 -63
- package/dist/icons/icon-element.js.map +0 -1
- package/dist/icons/index.d.ts.map +0 -1
- package/dist/icons/registry.d.ts +0 -6
- package/dist/icons/registry.d.ts.map +0 -1
- package/dist/icons/registry.js +0 -4775
- package/dist/icons/registry.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/jsx-runtime.d.ts.map +0 -1
- package/dist/jsx-types.d.ts +0 -651
- package/dist/jsx-types.d.ts.map +0 -1
- package/dist/jsx-types.js +0 -3
- package/dist/jsx-types.js.map +0 -1
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/router.d.ts +0 -4
- package/dist/plugins/router.d.ts.map +0 -1
- package/dist/plugins/router.js +0 -90
- package/dist/plugins/router.js.map +0 -1
- package/dist/plugins/types.d.ts +0 -16
- package/dist/plugins/types.d.ts.map +0 -1
- package/dist/plugins/types.js +0 -2
- package/dist/plugins/types.js.map +0 -1
- package/dist/react/icon.d.ts +0 -8
- package/dist/react/icon.d.ts.map +0 -1
- package/dist/react/icon.js +0 -7
- package/dist/react/icon.js.map +0 -1
- package/dist/react/icons.d.ts +0 -1194
- package/dist/react/icons.d.ts.map +0 -1
- package/dist/react/icons.js +0 -1196
- package/dist/react/icons.js.map +0 -1
- package/dist/react/index.d.ts.map +0 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// src/core/plugin.ts
|
|
2
|
+
function createPluginSystem() {
|
|
3
|
+
const pluginHooks = /* @__PURE__ */ new Map();
|
|
4
|
+
const registeredPlugins = /* @__PURE__ */ new Map();
|
|
5
|
+
const pluginHookCleanups = /* @__PURE__ */ new Map();
|
|
6
|
+
function registerPlugin2(plugin) {
|
|
7
|
+
if (!plugin || typeof plugin !== "object") {
|
|
8
|
+
throw new Error("Invalid plugin: plugin must be a non-null object");
|
|
9
|
+
}
|
|
10
|
+
if (typeof plugin.name !== "string" || plugin.name.length === 0) {
|
|
11
|
+
throw new Error("Invalid plugin: plugin.name must be a non-empty string");
|
|
12
|
+
}
|
|
13
|
+
if (typeof plugin.version !== "string") {
|
|
14
|
+
throw new Error("Invalid plugin: plugin.version must be a string");
|
|
15
|
+
}
|
|
16
|
+
if (typeof plugin.setup !== "function") {
|
|
17
|
+
throw new Error(`Invalid plugin "${plugin.name}": plugin.setup must be a function`);
|
|
18
|
+
}
|
|
19
|
+
if (registeredPlugins.has(plugin.name)) {
|
|
20
|
+
throw new Error(`Plugin "${plugin.name}" is already registered`);
|
|
21
|
+
}
|
|
22
|
+
registeredPlugins.set(plugin.name, plugin);
|
|
23
|
+
const cleanups = /* @__PURE__ */ new Set();
|
|
24
|
+
pluginHookCleanups.set(plugin.name, cleanups);
|
|
25
|
+
const pluginAPI = {
|
|
26
|
+
registerHook(name, fn) {
|
|
27
|
+
if (!pluginHooks.has(name)) {
|
|
28
|
+
pluginHooks.set(name, /* @__PURE__ */ new Set());
|
|
29
|
+
}
|
|
30
|
+
const hooks = pluginHooks.get(name);
|
|
31
|
+
hooks.add(fn);
|
|
32
|
+
const cleanup = () => {
|
|
33
|
+
hooks.delete(fn);
|
|
34
|
+
cleanups.delete(cleanup);
|
|
35
|
+
};
|
|
36
|
+
cleanups.add(cleanup);
|
|
37
|
+
return cleanup;
|
|
38
|
+
},
|
|
39
|
+
getHook(name) {
|
|
40
|
+
const hooks = pluginHooks.get(name);
|
|
41
|
+
return hooks ? new Set(hooks) : /* @__PURE__ */ new Set();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
plugin.setup(pluginAPI);
|
|
45
|
+
}
|
|
46
|
+
function unregisterPlugin2(name) {
|
|
47
|
+
const cleanups = pluginHookCleanups.get(name);
|
|
48
|
+
if (cleanups) {
|
|
49
|
+
for (const fn of cleanups) fn();
|
|
50
|
+
pluginHookCleanups.delete(name);
|
|
51
|
+
}
|
|
52
|
+
return registeredPlugins.delete(name);
|
|
53
|
+
}
|
|
54
|
+
function getPlugin2(name) {
|
|
55
|
+
return registeredPlugins.get(name);
|
|
56
|
+
}
|
|
57
|
+
function hasPlugin2(name) {
|
|
58
|
+
return registeredPlugins.has(name);
|
|
59
|
+
}
|
|
60
|
+
function runPluginHook2(name, ...args) {
|
|
61
|
+
const hooks = pluginHooks.get(name);
|
|
62
|
+
if (hooks) {
|
|
63
|
+
for (const fn of hooks) {
|
|
64
|
+
try {
|
|
65
|
+
fn(...args);
|
|
66
|
+
} catch (e) {
|
|
67
|
+
console.error(`Plugin hook "${name}" failed:`, e);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function getPluginAPI() {
|
|
73
|
+
return {
|
|
74
|
+
registerHook(name, fn) {
|
|
75
|
+
if (!pluginHooks.has(name)) {
|
|
76
|
+
pluginHooks.set(name, /* @__PURE__ */ new Set());
|
|
77
|
+
}
|
|
78
|
+
const hooks = pluginHooks.get(name);
|
|
79
|
+
hooks.add(fn);
|
|
80
|
+
return () => hooks.delete(fn);
|
|
81
|
+
},
|
|
82
|
+
getHook(name) {
|
|
83
|
+
const hooks = pluginHooks.get(name);
|
|
84
|
+
return hooks ? new Set(hooks) : /* @__PURE__ */ new Set();
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
registerPlugin: registerPlugin2,
|
|
90
|
+
unregisterPlugin: unregisterPlugin2,
|
|
91
|
+
getPlugin: getPlugin2,
|
|
92
|
+
hasPlugin: hasPlugin2,
|
|
93
|
+
runPluginHook: runPluginHook2,
|
|
94
|
+
getPluginAPI
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
var defaultSystem = createPluginSystem();
|
|
98
|
+
function registerPlugin(plugin) {
|
|
99
|
+
defaultSystem.registerPlugin(plugin);
|
|
100
|
+
}
|
|
101
|
+
function unregisterPlugin(name) {
|
|
102
|
+
return defaultSystem.unregisterPlugin(name);
|
|
103
|
+
}
|
|
104
|
+
function getPlugin(name) {
|
|
105
|
+
return defaultSystem.getPlugin(name);
|
|
106
|
+
}
|
|
107
|
+
function hasPlugin(name) {
|
|
108
|
+
return defaultSystem.hasPlugin(name);
|
|
109
|
+
}
|
|
110
|
+
function runPluginHook(name, ...args) {
|
|
111
|
+
defaultSystem.runPluginHook(name, ...args);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export { getPlugin, hasPlugin, registerPlugin, runPluginHook, unregisterPlugin };
|
|
115
|
+
//# sourceMappingURL=chunk-U4WYCYL6.js.map
|
|
116
|
+
//# sourceMappingURL=chunk-U4WYCYL6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/plugin.ts"],"names":["registerPlugin","unregisterPlugin","getPlugin","hasPlugin","runPluginHook"],"mappings":";AAWO,SAAS,kBAAA,GAAmC;AACjD,EAAA,MAAM,WAAA,uBAAkB,GAAA,EAA2C;AACnE,EAAA,MAAM,iBAAA,uBAAwB,GAAA,EAAoB;AAClD,EAAA,MAAM,kBAAA,uBAAyB,GAAA,EAA6B;AAE5D,EAAA,SAASA,gBAAe,MAAA,EAAsB;AAC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,CAAc,iBAAiB,IAAI,CAAA;AAC5C;AACO,SAAS,UAAU,IAAA,EAAkC;AAC1D,EAAA,OAAO,aAAA,CAAc,UAAU,IAAI,CAAA;AACrC;AACO,SAAS,UAAU,IAAA,EAAuB;AAC/C,EAAA,OAAO,aAAA,CAAc,UAAU,IAAI,CAAA;AACrC;AACO,SAAS,aAAA,CAAc,SAAiB,IAAA,EAAmB;AAChE,EAAA,aAAA,CAAc,aAAA,CAAc,IAAA,EAAM,GAAG,IAAI,CAAA;AAC3C","file":"chunk-U4WYCYL6.js","sourcesContent":["import type { Plugin, PluginAPI } from './types.js';\n\nexport interface PluginSystem {\n registerPlugin(plugin: Plugin): void;\n unregisterPlugin(name: string): boolean;\n getPlugin(name: string): Plugin | undefined;\n hasPlugin(name: string): boolean;\n runPluginHook(name: string, ...args: any[]): void;\n getPluginAPI(): PluginAPI;\n}\n\nexport function createPluginSystem(): PluginSystem {\n const pluginHooks = new Map<string, Set<(...args: any[]) => void>>();\n const registeredPlugins = new Map<string, Plugin>();\n const pluginHookCleanups = new Map<string, Set<() => void>>();\n\n function registerPlugin(plugin: Plugin): void {\n if (!plugin || typeof plugin !== 'object') {\n throw new Error('Invalid plugin: plugin must be a non-null object');\n }\n if (typeof plugin.name !== 'string' || plugin.name.length === 0) {\n throw new Error('Invalid plugin: plugin.name must be a non-empty string');\n }\n if (typeof plugin.version !== 'string') {\n throw new Error('Invalid plugin: plugin.version must be a string');\n }\n if (typeof plugin.setup !== 'function') {\n throw new Error(`Invalid plugin \"${plugin.name}\": plugin.setup must be a function`);\n }\n if (registeredPlugins.has(plugin.name)) {\n throw new Error(`Plugin \"${plugin.name}\" is already registered`);\n }\n registeredPlugins.set(plugin.name, plugin);\n\n const cleanups = new Set<() => void>();\n pluginHookCleanups.set(plugin.name, cleanups);\n\n const pluginAPI: PluginAPI = {\n registerHook(name: string, fn: (...args: any[]) => void): () => void {\n if (!pluginHooks.has(name)) {\n pluginHooks.set(name, new Set());\n }\n const hooks = pluginHooks.get(name)!;\n hooks.add(fn);\n const cleanup = () => {\n hooks.delete(fn);\n cleanups.delete(cleanup);\n };\n cleanups.add(cleanup);\n return cleanup;\n },\n\n getHook(name: string): Set<(...args: any[]) => void> {\n const hooks = pluginHooks.get(name);\n return hooks ? new Set(hooks) : new Set();\n },\n };\n\n plugin.setup(pluginAPI);\n }\n\n function unregisterPlugin(name: string): boolean {\n const cleanups = pluginHookCleanups.get(name);\n if (cleanups) {\n for (const fn of cleanups) fn();\n pluginHookCleanups.delete(name);\n }\n return registeredPlugins.delete(name);\n }\n\n function getPlugin(name: string): Plugin | undefined {\n return registeredPlugins.get(name);\n }\n\n function hasPlugin(name: string): boolean {\n return registeredPlugins.has(name);\n }\n\n function runPluginHook(name: string, ...args: any[]): void {\n const hooks = pluginHooks.get(name);\n if (hooks) {\n for (const fn of hooks) {\n try {\n fn(...args);\n } catch (e) {\n console.error(`Plugin hook \"${name}\" failed:`, e);\n }\n }\n }\n }\n\n function getPluginAPI(): PluginAPI {\n return {\n registerHook(name: string, fn: (...args: any[]) => void): () => void {\n if (!pluginHooks.has(name)) {\n pluginHooks.set(name, new Set());\n }\n const hooks = pluginHooks.get(name)!;\n hooks.add(fn);\n return () => hooks.delete(fn);\n },\n getHook(name: string): Set<(...args: any[]) => void> {\n const hooks = pluginHooks.get(name);\n return hooks ? new Set(hooks) : new Set();\n },\n };\n }\n\n return {\n registerPlugin,\n unregisterPlugin,\n getPlugin,\n hasPlugin,\n runPluginHook,\n getPluginAPI,\n };\n}\n\nconst defaultSystem = createPluginSystem();\n\nexport function registerPlugin(plugin: Plugin): void {\n defaultSystem.registerPlugin(plugin);\n}\nexport function unregisterPlugin(name: string): boolean {\n return defaultSystem.unregisterPlugin(name);\n}\nexport function getPlugin(name: string): Plugin | undefined {\n return defaultSystem.getPlugin(name);\n}\nexport function hasPlugin(name: string): boolean {\n return defaultSystem.hasPlugin(name);\n}\nexport function runPluginHook(name: string, ...args: any[]): void {\n defaultSystem.runPluginHook(name, ...args);\n}\nexport function getPluginAPI(): PluginAPI {\n return defaultSystem.getPluginAPI();\n}\n"]}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
export { UButton } from '
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
export { a0 as AccordionItemProps, A as AccordionProps, a1 as AnimatePreset, a as AnimateProps, a2 as BoxAs, B as BoxProps, a3 as BreadcrumbItem, b as BreadcrumbProps, c as ButtonProps, C as CalendarProps, d as CheckboxProps, e as CollectionProps, a4 as CollectionSelection, a5 as ComboboxOption, f as ComboboxProps, a6 as CommandItem, g as CommandPaletteProps, h as ContainerProps, a7 as ContextMenuItem, i as ContextMenuProps, a8 as DataTableColumn, D as DataTableProps, j as DialogRootProps, k as DismissableLayerProps, l as DrawerProps, a9 as DrawerSide, aa as DropdownItem, m as DropdownProps, F as FieldProps, n as FocusManagerProps, o as FocusScopeProps, p as FocusTrapProps, q as FormProps, G as GridProps, H as HoverableProps, I as InputProps, K as KeyboardNavigationProps, L as LabelProps, r as LinkProps, s as ListProps, ab as LiveRegionPoliteness, t as LiveRegionProps, M as ModalProps, O as OverlayProps, P as PopoverProps, ac as PopperPlacement, u as PopperProps, v as PortalProps, ad as PresenceAnimation, w as PresenceProps, x as PressableProps, R as RadioGroupProps, ae as RadioProps, y as RouterViewProps, af as SelectOption, z as SelectProps, E as SortableProps, J as SpacerProps, S as StackProps, N as SwitchProps, ag as TableColumn, T as TableProps, Q as TabsProps, ah as TextColor, U as TextProps, ai as TextSize, aj as TextWeight, V as TextareaProps, ak as ToastOptions, W as ToastProps, X as TooltipRootProps, Y as TransitionProps, al as TransitionType, am as TreeNodeData, Z as TreeProps, an as UAccordion, ao as UAccordionItem, ap as UAnimate, aq as UBox, ar as UBreadcrumb, as as UButton, at as UCalendar, au as UCheckbox, av as UCollection, aw as UCombobox, ax as UCommandPalette, ay as UContainer, az as UContextMenu, aA as UDataTable, aB as UDialogRoot, aC as UDismissableLayer, aD as UDrawer, aE as UDropdown, aF as UField, aG as UFocusManager, aH as UFocusScope, aI as UFocusTrap, aJ as UForm, aK as UGrid, aL as UHStack, aM as UHoverable, aN as UInput, aO as UKeyboardNavigation, aP as ULabel, aQ as ULink, aR as UList, aS as ULiveRegion, aT as UModal, aU as UOverlay, aV as UPopover, aW as UPopper, aX as UPortal, aY as UPresence, aZ as UPressable, a_ as URadio, a$ as URadioGroup, b0 as URouterView, b1 as USelect, b2 as USortable, b3 as USpacer, b4 as UStack, b5 as USwitch, b6 as UTable, b7 as UTabs, b8 as UText, b9 as UTextarea, ba as UToast, bb as UTooltipRoot, bc as UTransition, bd as UTree, be as UVirtualList, bf as UVisuallyHidden, _ as VirtualListProps, $ as VisuallyHiddenProps, bg as createControlledInput, bh as setPortalRoot } from '../form.wc-CwjVsdUu.js';
|
|
2
|
+
import { U as UElement } from '../element-DHtonJNX.js';
|
|
3
|
+
import '../types-DWglFa91.js';
|
|
4
|
+
|
|
5
|
+
interface SlotProps {
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
declare class USlot extends UElement {
|
|
9
|
+
constructor();
|
|
10
|
+
_mount(): void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { type SlotProps, USlot };
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export { UInput, createControlledInput } from '
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import '../chunk-MFONNOJU.js';
|
|
2
|
+
export { UAccordion, UAccordionItem, UAnimate, UBox, UBreadcrumb, UButton, UCalendar, UCheckbox, UCollection, UCombobox, UCommandPalette, UContainer, UContextMenu, UDataTable, UDialogRoot, UDismissableLayer, UDrawer, UDropdown, UField, UFocusManager, UFocusScope, UFocusTrap, UForm, UGrid, UHStack, UHoverable, UInput, UKeyboardNavigation, ULabel, ULink, UList, ULiveRegion, UModal, UOverlay, UPopover, UPopper, UPortal, UPresence, UPressable, URadio, URadioGroup, URouterView, USelect, USlot, USortable, USpacer, UStack, USwitch, UTable, UTabs, UText, UTextarea, UToast, UTooltipRoot, UTransition, UTree, UVirtualList, UVisuallyHidden, createControlledInput, setPortalRoot } from '../chunk-NJAZMTMT.js';
|
|
3
|
+
import '../chunk-PRZASPFU.js';
|
|
4
|
+
import '../chunk-Q5RCPPCF.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/dist/define.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
|
|
2
|
+
export { }
|
package/dist/define.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
import { defineComponents } from './
|
|
1
|
+
import { defineComponents } from './chunk-DO3PEBDS.js';
|
|
2
|
+
import './chunk-NJAZMTMT.js';
|
|
3
|
+
import './chunk-42QSY3LJ.js';
|
|
4
|
+
import './chunk-PRZASPFU.js';
|
|
5
|
+
import './chunk-Q5RCPPCF.js';
|
|
6
|
+
|
|
7
|
+
// src/define.ts
|
|
2
8
|
defineComponents();
|
|
9
|
+
//# sourceMappingURL=define.js.map
|
|
3
10
|
//# sourceMappingURL=define.js.map
|
package/dist/define.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/define.ts"],"names":[],"mappings":";;;;;;;AAEA,gBAAA,EAAiB","file":"define.js","sourcesContent":["import { defineComponents } from './core/define.js';\r\n\r\ndefineComponents();\r\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
declare abstract class UElement extends HTMLElement {
|
|
2
2
|
private _cleanups;
|
|
3
3
|
protected _root: ShadowRoot;
|
|
4
4
|
protected _id: number;
|
|
@@ -8,4 +8,5 @@ export declare abstract class UElement extends HTMLElement {
|
|
|
8
8
|
protected adoptEffect(fn: () => (() => void) | void): () => void;
|
|
9
9
|
protected abstract _mount(): void;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
export { UElement as U };
|