snice 3.4.0 → 3.5.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/bin/templates/base/package.json +2 -2
- package/bin/templates/social/package.json +2 -2
- package/bin/templates/social/src/styles/global.css +56 -47
- package/dist/components/avatar/snice-avatar.d.ts +2 -2
- package/dist/components/avatar/snice-avatar.js +20 -21
- package/dist/components/avatar/snice-avatar.js.map +1 -1
- package/dist/components/calendar/snice-calendar.d.ts +8 -2
- package/dist/components/calendar/snice-calendar.js +160 -82
- package/dist/components/calendar/snice-calendar.js.map +1 -1
- package/dist/components/chart/snice-chart.js +50 -18
- package/dist/components/chart/snice-chart.js.map +1 -1
- package/dist/components/checkbox/snice-checkbox.d.ts +4 -1
- package/dist/components/checkbox/snice-checkbox.js +46 -17
- package/dist/components/checkbox/snice-checkbox.js.map +1 -1
- package/dist/components/code-block/highlighter.d.ts +5 -0
- package/dist/components/code-block/highlighter.js +137 -0
- package/dist/components/code-block/highlighter.js.map +1 -0
- package/dist/components/code-block/highlighters/highlight.d.ts +64 -0
- package/dist/components/code-block/highlighters/highlight.js +108 -0
- package/dist/components/code-block/highlighters/highlight.js.map +1 -0
- package/dist/components/code-block/highlighters/prism.d.ts +41 -0
- package/dist/components/code-block/highlighters/prism.js +73 -0
- package/dist/components/code-block/highlighters/prism.js.map +1 -0
- package/dist/components/code-block/snice-code-block.d.ts +19 -1
- package/dist/components/code-block/snice-code-block.js +128 -29
- package/dist/components/code-block/snice-code-block.js.map +1 -1
- package/dist/components/code-block/snice-code-block.types.d.ts +15 -1
- package/dist/components/color-picker/snice-color-picker.d.ts +1 -0
- package/dist/components/color-picker/snice-color-picker.js +17 -6
- package/dist/components/color-picker/snice-color-picker.js.map +1 -1
- package/dist/components/date-picker/snice-date-picker.d.ts +1 -0
- package/dist/components/date-picker/snice-date-picker.js +16 -5
- package/dist/components/date-picker/snice-date-picker.js.map +1 -1
- package/dist/components/doc/snice-doc.d.ts +27 -73
- package/dist/components/doc/snice-doc.js +385 -534
- package/dist/components/doc/snice-doc.js.map +1 -1
- package/dist/components/draw/snice-draw.d.ts +4 -0
- package/dist/components/draw/snice-draw.js +134 -14
- package/dist/components/draw/snice-draw.js.map +1 -1
- package/dist/components/draw/snice-draw.types.d.ts +5 -0
- package/dist/components/file-upload/snice-file-upload.js +1 -1
- package/dist/components/input/snice-input.d.ts +2 -0
- package/dist/components/input/snice-input.js +34 -9
- package/dist/components/input/snice-input.js.map +1 -1
- package/dist/components/kanban/snice-kanban.d.ts +13 -1
- package/dist/components/kanban/snice-kanban.js +191 -36
- package/dist/components/kanban/snice-kanban.js.map +1 -1
- package/dist/components/kanban/snice-kanban.types.d.ts +11 -1
- package/dist/components/kpi/snice-kpi.js +5 -1
- package/dist/components/kpi/snice-kpi.js.map +1 -1
- package/dist/components/layout/snice-layout-sidebar.js +1 -1
- package/dist/components/layout/snice-layout-sidebar.js.map +1 -1
- package/dist/components/layout/snice-layout.js +1 -1
- package/dist/components/layout/snice-layout.js.map +1 -1
- package/dist/components/location/snice-location.js +1 -1
- package/dist/components/location/snice-location.js.map +1 -1
- package/dist/components/radio/snice-radio.d.ts +1 -0
- package/dist/components/radio/snice-radio.js +17 -6
- package/dist/components/radio/snice-radio.js.map +1 -1
- package/dist/components/select/snice-select.d.ts +2 -0
- package/dist/components/select/snice-select.js +48 -19
- package/dist/components/select/snice-select.js.map +1 -1
- package/dist/components/slider/snice-slider.d.ts +2 -0
- package/dist/components/slider/snice-slider.js +34 -14
- package/dist/components/slider/snice-slider.js.map +1 -1
- package/dist/components/snice-cell-HZ2iIBIC.js +4 -0
- package/dist/components/snice-cell-HZ2iIBIC.js.map +1 -0
- package/dist/components/split-pane/snice-split-pane.js +1 -1
- package/dist/components/split-pane/snice-split-pane.js.map +1 -1
- package/dist/components/switch/snice-switch.d.ts +1 -0
- package/dist/components/switch/snice-switch.js +16 -6
- package/dist/components/switch/snice-switch.js.map +1 -1
- package/dist/components/table/snice-cell-actions.js +1 -1
- package/dist/components/table/snice-cell-actions.js.map +1 -1
- package/dist/components/table/snice-cell-boolean.js +1 -1
- package/dist/components/table/snice-cell-color.js +1 -1
- package/dist/components/table/snice-cell-color.js.map +1 -1
- package/dist/components/table/snice-cell-currency.js +1 -1
- package/dist/components/table/snice-cell-date.js +1 -1
- package/dist/components/table/snice-cell-duration.js +1 -1
- package/dist/components/table/snice-cell-email.js +1 -1
- package/dist/components/table/snice-cell-email.js.map +1 -1
- package/dist/components/table/snice-cell-filesize.js +1 -1
- package/dist/components/table/snice-cell-image.js +1 -1
- package/dist/components/table/snice-cell-image.js.map +1 -1
- package/dist/components/table/snice-cell-json.js +1 -1
- package/dist/components/table/snice-cell-json.js.map +1 -1
- package/dist/components/table/snice-cell-link.js +1 -1
- package/dist/components/table/snice-cell-link.js.map +1 -1
- package/dist/components/table/snice-cell-location.js +1 -1
- package/dist/components/table/snice-cell-location.js.map +1 -1
- package/dist/components/table/snice-cell-number.js +1 -1
- package/dist/components/table/snice-cell-percentage.js +1 -1
- package/dist/components/table/snice-cell-percentage.js.map +1 -1
- package/dist/components/table/snice-cell-phone.js +1 -1
- package/dist/components/table/snice-cell-phone.js.map +1 -1
- package/dist/components/table/snice-cell-progress.js +3 -3
- package/dist/components/table/snice-cell-progress.js.map +1 -1
- package/dist/components/table/snice-cell-rating.js +2 -2
- package/dist/components/table/snice-cell-rating.js.map +1 -1
- package/dist/components/table/snice-cell-sparkline.js +2 -2
- package/dist/components/table/snice-cell-sparkline.js.map +1 -1
- package/dist/components/table/snice-cell-status.js +1 -1
- package/dist/components/table/snice-cell-status.js.map +1 -1
- package/dist/components/table/snice-cell-tag.js +1 -1
- package/dist/components/table/snice-cell-tag.js.map +1 -1
- package/dist/components/table/snice-cell-text.js +1 -1
- package/dist/components/table/snice-cell.js +15 -10
- package/dist/components/table/snice-cell.js.map +1 -1
- package/dist/components/table/snice-header.js +1 -1
- package/dist/components/table/snice-header.js.map +1 -1
- package/dist/components/table/snice-row.js +2 -2
- package/dist/components/table/snice-row.js.map +1 -1
- package/dist/components/table/snice-table.d.ts +1 -0
- package/dist/components/table/snice-table.js +24 -4
- package/dist/components/table/snice-table.js.map +1 -1
- package/dist/components/terminal/snice-terminal.d.ts +40 -0
- package/dist/components/terminal/snice-terminal.js +371 -0
- package/dist/components/terminal/snice-terminal.js.map +1 -0
- package/dist/components/terminal/snice-terminal.types.d.ts +20 -24
- package/dist/components/textarea/snice-textarea.d.ts +2 -0
- package/dist/components/textarea/snice-textarea.js +25 -6
- package/dist/components/textarea/snice-textarea.js.map +1 -1
- package/dist/components/theme/theme.css +16 -0
- package/dist/components/tree/snice-tree-item.d.ts +18 -4
- package/dist/components/tree/snice-tree-item.js +271 -88
- package/dist/components/tree/snice-tree-item.js.map +1 -1
- package/dist/components/tree/snice-tree-item.types.d.ts +3 -0
- package/dist/components/tree/snice-tree.d.ts +18 -2
- package/dist/components/tree/snice-tree.js +422 -56
- package/dist/components/tree/snice-tree.js.map +1 -1
- package/dist/components/tree/snice-tree.types.d.ts +1 -0
- package/dist/components/virtual-scroller/snice-virtual-scroller.js +4 -2
- package/dist/components/virtual-scroller/snice-virtual-scroller.js.map +1 -1
- package/dist/index.cjs +42 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +42 -23
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +42 -23
- package/dist/index.iife.js.map +1 -1
- package/dist/render-tracker.d.ts +1 -0
- package/dist/symbols.cjs +13 -14
- package/dist/symbols.cjs.map +1 -1
- package/dist/symbols.esm.js +13 -14
- package/dist/symbols.esm.js.map +1 -1
- package/dist/template.d.ts +1 -0
- package/dist/transitions.cjs +1 -1
- package/dist/transitions.esm.js +1 -1
- package/docs/ai/api.md +37 -4
- package/docs/ai/components/doc.md +41 -106
- package/docs/ai/components/kanban.md +31 -9
- package/docs/ai/components/kpi.md +15 -0
- package/docs/components/doc.md +96 -212
- package/docs/components/kanban.md +119 -4
- package/docs/components/kpi.md +27 -0
- package/package.json +4 -1
- package/dist/components/actions/snice-actions.d.ts +0 -28
- package/dist/components/actions/snice-actions.js +0 -220
- package/dist/components/actions/snice-actions.js.map +0 -1
- package/dist/components/actions/snice-actions.types.d.ts +0 -27
- package/dist/components/doc/snice-doc.types.d.ts +0 -118
- package/dist/components/gantt/snice-gantt.d.ts +0 -29
- package/dist/components/gantt/snice-gantt.js +0 -268
- package/dist/components/gantt/snice-gantt.js.map +0 -1
- package/dist/components/gantt/snice-gantt.types.d.ts +0 -23
- package/dist/components/snice-cell-C0slgOpe.js +0 -4
- package/dist/components/snice-cell-C0slgOpe.js.map +0 -1
- package/dist/components/stat/snice-stat.d.ts +0 -14
- package/dist/components/stat/snice-stat.js +0 -140
- package/dist/components/stat/snice-stat.js.map +0 -1
- package/dist/components/stat/snice-stat.types.d.ts +0 -12
- package/docs/ai/components/actions.md +0 -81
- package/docs/ai/components/gantt.md +0 -95
- package/docs/ai/components/stat.md +0 -29
- package/docs/components/actions.md +0 -317
- package/docs/components/gantt.md +0 -347
- package/docs/components/stat.md +0 -45
package/dist/index.iife.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* snice v3.
|
|
2
|
+
* snice v3.4.1
|
|
3
3
|
* Imperative TypeScript framework for building vanilla web components with decorators, differential rendering, routing, and controllers. No virtual DOM, no build complexity.
|
|
4
4
|
* (c) 2024
|
|
5
5
|
* Released under the MIT License.
|
|
@@ -9,23 +9,22 @@ var Snice = (function (exports) {
|
|
|
9
9
|
|
|
10
10
|
// Global namespace for Snice framework
|
|
11
11
|
// Ensures all registries and symbols are shared across different JS files/modules
|
|
12
|
-
// Initialize
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
return globalThis.snice;
|
|
12
|
+
// Initialize the global Snice namespace on globalThis
|
|
13
|
+
// This ensures all module instances share the same registry
|
|
14
|
+
if (!globalThis.snice) {
|
|
15
|
+
globalThis.snice = {
|
|
16
|
+
controllerRegistry: new Map(),
|
|
17
|
+
controllerIdCounter: 0,
|
|
18
|
+
symbols: new Map()
|
|
19
|
+
};
|
|
22
20
|
}
|
|
23
|
-
// Export
|
|
24
|
-
const snice =
|
|
21
|
+
// Export direct reference to globalThis.snice
|
|
22
|
+
const snice = globalThis.snice;
|
|
25
23
|
// Helper function to get or create a global symbol
|
|
24
|
+
// Uses Symbol.for() to ensure symbols are shared across multiple Snice instances
|
|
26
25
|
function getSymbol(name) {
|
|
27
26
|
if (!snice.symbols.has(name)) {
|
|
28
|
-
snice.symbols.set(name, Symbol(name));
|
|
27
|
+
snice.symbols.set(name, Symbol.for(`snice:${name}`));
|
|
29
28
|
}
|
|
30
29
|
return snice.symbols.get(name);
|
|
31
30
|
}
|
|
@@ -708,8 +707,9 @@ var Snice = (function (exports) {
|
|
|
708
707
|
* Provides html`` and css`` tagged template processors with differential rendering
|
|
709
708
|
*/
|
|
710
709
|
// Unique symbols for type checking
|
|
711
|
-
|
|
712
|
-
const
|
|
710
|
+
// Use Symbol.for() to ensure symbols are shared across multiple Snice instances
|
|
711
|
+
const HTML_RESULT = Symbol.for('snice:html-result');
|
|
712
|
+
const CSS_RESULT = Symbol.for('snice:css-result');
|
|
713
713
|
/**
|
|
714
714
|
* Tagged template function for creating HTML templates
|
|
715
715
|
*
|
|
@@ -778,10 +778,12 @@ var Snice = (function (exports) {
|
|
|
778
778
|
/**
|
|
779
779
|
* Nothing - represents no value (different from null/undefined)
|
|
780
780
|
* Used to remove content from templates
|
|
781
|
+
* Use Symbol.for() to ensure symbols are shared across multiple Snice instances
|
|
781
782
|
*/
|
|
782
|
-
const nothing = Symbol('nothing');
|
|
783
|
+
const nothing = Symbol.for('snice:nothing');
|
|
783
784
|
// Unique symbol for unsafe HTML
|
|
784
|
-
|
|
785
|
+
// Use Symbol.for() to ensure symbols are shared across multiple Snice instances
|
|
786
|
+
const UNSAFE_HTML = Symbol.for('snice:unsafe-html');
|
|
785
787
|
/**
|
|
786
788
|
* Mark a string as raw HTML that should not be escaped
|
|
787
789
|
* WARNING: Only use with sanitized content - using user input can lead to XSS!
|
|
@@ -1646,8 +1648,9 @@ var Snice = (function (exports) {
|
|
|
1646
1648
|
context.addInitializer(function () {
|
|
1647
1649
|
const constructor = this.constructor;
|
|
1648
1650
|
// Only initialize once per class, not per instance
|
|
1649
|
-
if (constructor[initKey])
|
|
1651
|
+
if (constructor[initKey]) {
|
|
1650
1652
|
return;
|
|
1653
|
+
}
|
|
1651
1654
|
constructor[initKey] = true;
|
|
1652
1655
|
if (!constructor[ON_HANDLERS]) {
|
|
1653
1656
|
constructor[ON_HANDLERS] = [];
|
|
@@ -1835,7 +1838,10 @@ var Snice = (function (exports) {
|
|
|
1835
1838
|
// If element has shadow root, listen on both shadow root AND host element
|
|
1836
1839
|
// to catch events from inside shadow DOM (with correct target) and on host itself
|
|
1837
1840
|
const shadowRoot = targetElement.shadowRoot;
|
|
1838
|
-
|
|
1841
|
+
// Use Symbol.for() with method name to ensure symbols are shared across Snice instances
|
|
1842
|
+
// Method names are unique within a class, so this prevents double-firing of the same handler
|
|
1843
|
+
// while allowing multiple different handlers on the same event
|
|
1844
|
+
const handledSymbol = Symbol.for(`snice:event-handled:${handler.methodName}`);
|
|
1839
1845
|
const wrappedMethod = (event) => {
|
|
1840
1846
|
// Prevent double-triggering when listening on both shadow root and host
|
|
1841
1847
|
if (event[handledSymbol]) {
|
|
@@ -1942,7 +1948,12 @@ var Snice = (function (exports) {
|
|
|
1942
1948
|
*/
|
|
1943
1949
|
function controller(name) {
|
|
1944
1950
|
return function (constructor, _context) {
|
|
1945
|
-
snice
|
|
1951
|
+
// Access globalThis.snice directly to ensure consistency
|
|
1952
|
+
const registry = globalThis.snice?.controllerRegistry;
|
|
1953
|
+
if (!registry) {
|
|
1954
|
+
throw new Error('Snice global registry not initialized');
|
|
1955
|
+
}
|
|
1956
|
+
registry.set(name, constructor);
|
|
1946
1957
|
// Mark as controller class for channel decorator detection
|
|
1947
1958
|
constructor.prototype[IS_CONTROLLER_CLASS] = true;
|
|
1948
1959
|
return constructor;
|
|
@@ -1970,8 +1981,15 @@ var Snice = (function (exports) {
|
|
|
1970
1981
|
if (existingController) {
|
|
1971
1982
|
await detachController(element);
|
|
1972
1983
|
}
|
|
1973
|
-
|
|
1984
|
+
// Access globalThis.snice directly to ensure consistency
|
|
1985
|
+
const registry = globalThis.snice?.controllerRegistry;
|
|
1986
|
+
if (!registry) {
|
|
1987
|
+
throw new Error('Snice global registry not initialized');
|
|
1988
|
+
}
|
|
1989
|
+
const ControllerClass = registry.get(controllerName);
|
|
1974
1990
|
if (!ControllerClass) {
|
|
1991
|
+
// Debug: log what's actually in the registry
|
|
1992
|
+
console.error(`Controller "${controllerName}" not found. Available:`, Array.from(registry.keys()));
|
|
1975
1993
|
throw new Error(`Controller "${controllerName}" not found in registry`);
|
|
1976
1994
|
}
|
|
1977
1995
|
// Create controller instance with unique ID and scope
|
|
@@ -2341,7 +2359,8 @@ var Snice = (function (exports) {
|
|
|
2341
2359
|
|
|
2342
2360
|
var _a, _b, _c;
|
|
2343
2361
|
// Symbol for storing the Set of elements
|
|
2344
|
-
|
|
2362
|
+
// Use Symbol.for() to ensure symbols are shared across multiple Snice instances
|
|
2363
|
+
const REGISTERED_ELEMENTS_SET = Symbol.for('snice:registered-elements-set');
|
|
2345
2364
|
// Counter for generating unique context IDs
|
|
2346
2365
|
let contextIdCounter = 0;
|
|
2347
2366
|
/**
|