@rokkit/core 1.0.0-next.113 → 1.0.0-next.115

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.
Files changed (163) hide show
  1. package/dist/packages/actions/src/delegate.svelte.d.ts +13 -0
  2. package/dist/packages/actions/src/dismissable.svelte.d.ts +7 -0
  3. package/dist/packages/actions/src/fillable.svelte.d.ts +8 -0
  4. package/dist/packages/actions/src/index.d.ts +11 -0
  5. package/dist/packages/actions/src/kbd.d.ts +44 -0
  6. package/dist/packages/actions/src/keyboard.svelte.d.ts +7 -0
  7. package/dist/packages/actions/src/lib/event-manager.d.ts +8 -0
  8. package/dist/packages/actions/src/lib/index.d.ts +2 -0
  9. package/dist/packages/actions/src/lib/internal.d.ts +19 -0
  10. package/dist/packages/actions/src/navigable.svelte.d.ts +8 -0
  11. package/dist/packages/actions/src/navigator.svelte.d.ts +20 -0
  12. package/dist/packages/actions/src/pannable.svelte.d.ts +6 -0
  13. package/dist/packages/actions/src/skinnable.svelte.d.ts +8 -0
  14. package/dist/packages/actions/src/swipeable.svelte.d.ts +14 -0
  15. package/dist/packages/actions/src/themable.svelte.d.ts +7 -0
  16. package/dist/packages/actions/src/types.d.ts +72 -0
  17. package/dist/packages/actions/src/utils.d.ts +18 -0
  18. package/dist/packages/bits-ui/src/index.d.ts +2 -0
  19. package/dist/packages/bits-ui/src/reference.d.ts +22 -0
  20. package/dist/packages/bits-ui/src/tree/constants.d.ts +13 -0
  21. package/dist/packages/bits-ui/src/tree/index.d.ts +7 -0
  22. package/dist/packages/bits-ui/src/tree/types.d.ts +71 -0
  23. package/dist/packages/core/src/calendar.d.ts +10 -0
  24. package/dist/packages/core/src/colors/index.d.ts +333 -0
  25. package/dist/packages/core/src/connector.d.ts +8 -0
  26. package/dist/packages/core/src/constants.d.ts +39 -0
  27. package/dist/packages/core/src/events.d.ts +12 -0
  28. package/dist/packages/core/src/field-mapper.d.ts +63 -0
  29. package/dist/packages/core/src/index.d.ts +13 -0
  30. package/dist/packages/core/src/key-event-map.d.ts +18 -0
  31. package/dist/packages/core/src/mapped-items.d.ts +14 -0
  32. package/dist/packages/core/src/mapping.d.ts +75 -0
  33. package/dist/packages/core/src/nested.d.ts +18 -0
  34. package/dist/packages/core/src/string.d.ts +59 -0
  35. package/dist/packages/core/src/theme.d.ts +52 -0
  36. package/dist/packages/core/src/ticks.d.ts +10 -0
  37. package/dist/packages/core/src/types.d.ts +245 -0
  38. package/dist/packages/core/src/utils.d.ts +70 -0
  39. package/dist/packages/data/src/aggregators.d.ts +2 -0
  40. package/dist/packages/data/src/constants.d.ts +46 -0
  41. package/dist/packages/data/src/convert.d.ts +10 -0
  42. package/dist/packages/data/src/dataset.d.ts +43 -0
  43. package/dist/packages/data/src/filter.d.ts +26 -0
  44. package/dist/packages/data/src/formatter.d.ts +10 -0
  45. package/dist/packages/data/src/hierarchy.d.ts +36 -0
  46. package/dist/packages/data/src/index.d.ts +7 -0
  47. package/dist/packages/data/src/infer.d.ts +80 -0
  48. package/dist/packages/data/src/join.d.ts +95 -0
  49. package/dist/packages/data/src/list.d.ts +121 -0
  50. package/dist/packages/data/src/metadata.d.ts +32 -0
  51. package/dist/packages/data/src/model.d.ts +29 -0
  52. package/dist/packages/data/src/parser.d.ts +31 -0
  53. package/dist/packages/data/src/renamer.d.ts +37 -0
  54. package/dist/packages/data/src/rollup.d.ts +51 -0
  55. package/dist/packages/data/src/types.d.ts +346 -0
  56. package/dist/packages/data/src/utils.d.ts +6 -0
  57. package/dist/packages/data/src/view.d.ts +35 -0
  58. package/dist/packages/helpers/src/components/index.d.ts +2 -0
  59. package/dist/packages/helpers/src/index.d.ts +1 -0
  60. package/dist/packages/helpers/src/matchers/action.d.ts +27 -0
  61. package/dist/packages/helpers/src/matchers/array.d.ts +10 -0
  62. package/dist/packages/helpers/src/matchers/dataset.d.ts +10 -0
  63. package/dist/packages/helpers/src/matchers/event.d.ts +10 -0
  64. package/dist/packages/helpers/src/matchers/index.d.ts +4 -0
  65. package/dist/packages/helpers/src/matchers/internal.d.ts +1 -0
  66. package/dist/packages/helpers/src/mocks/animate.d.ts +1 -0
  67. package/dist/packages/helpers/src/mocks/element.d.ts +60 -0
  68. package/dist/packages/helpers/src/mocks/index.d.ts +2 -0
  69. package/dist/packages/helpers/src/mocks/match-media.d.ts +30 -0
  70. package/dist/packages/helpers/src/mocks/resize-observer.d.ts +9 -0
  71. package/dist/packages/helpers/src/simulators/index.d.ts +1 -0
  72. package/dist/packages/helpers/src/simulators/touch.d.ts +40 -0
  73. package/dist/packages/icons/src/convert.d.ts +22 -0
  74. package/dist/packages/icons/src/index.d.ts +2 -0
  75. package/dist/packages/input/src/index.d.ts +18 -0
  76. package/dist/packages/states/src/constants.d.ts +27 -0
  77. package/dist/packages/states/src/derive.svelte.d.ts +22 -0
  78. package/dist/packages/states/src/hierarchy.d.ts +34 -0
  79. package/dist/packages/states/src/index.d.ts +5 -0
  80. package/dist/packages/states/src/list-controller.svelte.d.ts +70 -0
  81. package/dist/packages/states/src/nested-controller.svelte.d.ts +32 -0
  82. package/dist/packages/states/src/proxy.svelte.d.ts +43 -0
  83. package/dist/packages/states/src/tabular.svelte.d.ts +5 -0
  84. package/dist/packages/states/src/traversal.svelte.d.ts +69 -0
  85. package/dist/packages/states/src/vibe.svelte.d.ts +622 -0
  86. package/dist/packages/themes/src/constants.d.ts +6 -0
  87. package/dist/packages/themes/src/index.d.ts +2 -0
  88. package/dist/packages/tutorial/src/assimilate.d.ts +25 -0
  89. package/dist/packages/tutorial/src/collector.d.ts +46 -0
  90. package/dist/packages/tutorial/src/files.d.ts +8 -0
  91. package/dist/packages/tutorial/src/index.d.ts +2 -0
  92. package/dist/packages/tutorial/src/metadata/base.d.ts +19 -0
  93. package/dist/packages/tutorial/src/metadata/factory.d.ts +19 -0
  94. package/dist/packages/tutorial/src/metadata/index.d.ts +2 -0
  95. package/dist/packages/tutorial/src/metadata/javascript.d.ts +7 -0
  96. package/dist/packages/tutorial/src/metadata/json.d.ts +7 -0
  97. package/dist/packages/tutorial/src/metadata/markdown.d.ts +7 -0
  98. package/dist/packages/tutorial/src/metadata/registry.d.ts +26 -0
  99. package/dist/packages/tutorial/src/metamodel.d.ts +45 -0
  100. package/dist/packages/tutorial/src/tutorial.d.ts +21 -0
  101. package/dist/packages/tutorial/src/types.d.ts +172 -0
  102. package/dist/packages/tutorial/src/utils.d.ts +13 -0
  103. package/dist/packages/ui/src/constants.d.ts +2 -0
  104. package/dist/packages/ui/src/index.d.ts +42 -0
  105. package/dist/packages/ui/src/input/types.d.ts +9 -0
  106. package/dist/packages/ui/src/lib/fields.d.ts +16 -0
  107. package/dist/packages/ui/src/lib/form.d.ts +95 -0
  108. package/dist/packages/ui/src/lib/index.d.ts +6 -0
  109. package/dist/packages/ui/src/lib/layout.d.ts +7 -0
  110. package/dist/packages/ui/src/lib/nested.d.ts +48 -0
  111. package/dist/packages/ui/src/lib/schema.d.ts +7 -0
  112. package/dist/packages/ui/src/lib/select.d.ts +8 -0
  113. package/dist/packages/ui/src/lib/tree.d.ts +9 -0
  114. package/dist/packages/ui/src/types.d.ts +5 -0
  115. package/dist/packages/ui/src/wrappers/index.d.ts +3 -0
  116. package/dist/sites/learn/src/hooks.d.ts +1 -0
  117. package/dist/sites/learn/src/hooks.server.d.ts +2 -0
  118. package/dist/sites/learn/src/lib/index.d.ts +7 -0
  119. package/dist/sites/learn/src/lib/media.d.ts +13 -0
  120. package/dist/sites/learn/src/lib/paraglide/messages/en.d.ts +3 -0
  121. package/dist/sites/learn/src/lib/paraglide/messages/fr.d.ts +3 -0
  122. package/dist/sites/learn/src/lib/paraglide/messages/hi.d.ts +3 -0
  123. package/dist/sites/learn/src/lib/paraglide/messages.d.ts +5 -0
  124. package/dist/sites/learn/src/lib/paraglide/runtime.d.ts +52 -0
  125. package/dist/sites/learn/src/lib/stories/02-elements/01-list/03-mapping/src/data.d.ts +5 -0
  126. package/dist/sites/learn/src/lib/stories/02-elements/01-list/04-mixed/src/data.d.ts +13 -0
  127. package/dist/sites/learn/src/lib/stories/02-elements/02-tabs/04-fields/src/data.d.ts +5 -0
  128. package/dist/sites/learn/src/lib/stories/02-elements/02-tabs/05-using/src/data.d.ts +6 -0
  129. package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/01-intro/src/data.d.ts +4 -0
  130. package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/02-fields/src/data.d.ts +9 -0
  131. package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/03-using/src/data.d.ts +19 -0
  132. package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/04-mixed/src/data.d.ts +30 -0
  133. package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/props.d.ts +15 -0
  134. package/dist/sites/learn/src/lib/stories/02-elements/04-tree/01-intro/src/data.d.ts +12 -0
  135. package/dist/sites/learn/src/lib/stories/02-elements/06-select/02-fields/src/data.d.ts +5 -0
  136. package/dist/sites/learn/src/lib/stories/02-elements/07-multi-select/02-fields/src/data.d.ts +5 -0
  137. package/dist/sites/learn/src/lib/stories/02-elements/08-drop-down/02-fields/src/data.d.ts +5 -0
  138. package/dist/sites/learn/src/lib/stories/05-templates/01-form/02-schema/src/schema.d.ts +22 -0
  139. package/dist/sites/learn/src/lib/stories/05-templates/01-form/03-layout/src/layout.d.ts +19 -0
  140. package/dist/sites/learn/src/lib/stories/05-templates/01-form/03-layout/src/schema.d.ts +36 -0
  141. package/dist/sites/learn/src/lib/stories/05-templates/01-form/05-validation/src/schema.d.ts +34 -0
  142. package/dist/sites/learn/src/lib/stories/05-templates/02-editor/01-introduction/src/data.d.ts +39 -0
  143. package/dist/sites/learn/src/lib/stories/05-templates/02-editor/01-introduction/src/schema.d.ts +187 -0
  144. package/dist/sites/learn/src/lib/stories/06-layout/03-stepper/01-intro/src/data.d.ts +37 -0
  145. package/dist/sites/learn/src/lib/stories/06-layout/03-stepper/02-play/src/data.d.ts +37 -0
  146. package/dist/sites/learn/src/lib/stories/index.d.ts +1 -0
  147. package/dist/sites/learn/src/lib/theme.svelte.d.ts +70 -0
  148. package/dist/sites/learn/src/routes/(learn)/+layout.d.ts +12 -0
  149. package/dist/sites/learn/src/routes/(learn)/[segment]/[...slug]/+page.d.ts +8 -0
  150. package/dist/sites/learn/src/routes/+layout.d.ts +18 -0
  151. package/dist/sites/quick-start/src/hooks.d.ts +1 -0
  152. package/dist/sites/quick-start/src/hooks.server.d.ts +2 -0
  153. package/dist/sites/quick-start/src/lib/index.d.ts +1 -0
  154. package/dist/sites/quick-start/src/lib/paraglide/messages/en.d.ts +3 -0
  155. package/dist/sites/quick-start/src/lib/paraglide/messages/fr.d.ts +3 -0
  156. package/dist/sites/quick-start/src/lib/paraglide/messages/hi.d.ts +3 -0
  157. package/dist/sites/quick-start/src/lib/paraglide/messages.d.ts +5 -0
  158. package/dist/sites/quick-start/src/lib/paraglide/runtime.d.ts +52 -0
  159. package/dist/sites/quick-start/src/routes/+layout.d.ts +9 -0
  160. package/dist/utils.d.ts +1 -1
  161. package/package.json +2 -2
  162. package/src/constants.js +5 -4
  163. package/src/utils.js +5 -3
@@ -0,0 +1,27 @@
1
+ export namespace DEFAULT_EVENTS {
2
+ export { noop as move };
3
+ export { noop as select };
4
+ export { noop as expand };
5
+ export { noop as collapse };
6
+ }
7
+ export const VALID_DENSITIES: string[];
8
+ export const VALID_MODES: string[];
9
+ /** @type {string[]} */
10
+ export const DEFAULT_STYLES: string[];
11
+ export namespace DEFAULT_VIBE_OPTIONS {
12
+ export { DEFAULT_STYLES as allowed };
13
+ export let style: string;
14
+ export let mode: string;
15
+ export let density: string;
16
+ }
17
+ export namespace DEFAULT_VIBE_PALETTE {
18
+ let primary: string;
19
+ let secondary: string;
20
+ let success: string;
21
+ let info: string;
22
+ let warning: string;
23
+ let danger: string;
24
+ let light: string;
25
+ let dark: string;
26
+ }
27
+ import { noop } from '@rokkit/core';
@@ -0,0 +1,22 @@
1
+ /**
2
+ *
3
+ * @param {Array<*>} items
4
+ * @param {import('@rokkit/core').FieldMapping} fields
5
+ * @param {Array<number>} path
6
+ * @returns {Array<{ key: string, value: any }>}
7
+ */
8
+ export function flatVisibleNodes(items: Array<any>, fields?: import("@rokkit/core").FieldMapping, path?: Array<number>): Array<{
9
+ key: string;
10
+ value: any;
11
+ }>;
12
+ /**
13
+ * Derives a flat lookup table for the given items, using index paths as keys
14
+ * Each value is a Proxy instance for convenient manipulation
15
+ *
16
+ * @param {Array<*>} items - Source items array
17
+ * @param {import('@rokkit/core').FieldMapping} fields - Field mappings configuration
18
+ * @param {Array<number>} path - Current path in the tree
19
+ * @returns {Map<string, Proxy>} - Map of path keys to Proxy instances
20
+ */
21
+ export function deriveLookupWithProxy(items: Array<any>, fields?: import("@rokkit/core").FieldMapping, path?: Array<number>): Map<string, Proxy>;
22
+ import { Proxy } from './proxy.svelte';
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @typedef {Object} HierarchyItem
3
+ * @property {number} depth - The depth of the item in the hierarchy.
4
+ * @property {Array<number>} path - The path of the item in the hierarchy.
5
+ * @property {any} item - The item itself.
6
+ * @property {HierarchyItem} parent - The reference to the parent item.
7
+ */
8
+ /**
9
+ * Converts a hierarchy of items into a flat array of objects.
10
+
11
+ * @param {Array<any>} items - The array of items to convert.
12
+ * @param {import('@rokkit/core').FieldMapper} mapping - The field mapper to use for mapping.
13
+ * @param {HierarchyItem} parent - The current path of the item.
14
+ * @returns {Array<Object>} - The flat array of objects.
15
+ */
16
+ export function flatHierarchy(items: Array<any>, mapping: import("@rokkit/core").FieldMapper, parent?: HierarchyItem): Array<Object>;
17
+ export type HierarchyItem = {
18
+ /**
19
+ * - The depth of the item in the hierarchy.
20
+ */
21
+ depth: number;
22
+ /**
23
+ * - The path of the item in the hierarchy.
24
+ */
25
+ path: Array<number>;
26
+ /**
27
+ * - The item itself.
28
+ */
29
+ item: any;
30
+ /**
31
+ * - The reference to the parent item.
32
+ */
33
+ parent: HierarchyItem;
34
+ };
@@ -0,0 +1,5 @@
1
+ export { TableWrapper } from "./tabular.svelte";
2
+ export { Proxy } from "./proxy.svelte";
3
+ export { vibe } from "./vibe.svelte";
4
+ export { ListController } from "./list-controller.svelte";
5
+ export { NestedController } from "./nested-controller.svelte";
@@ -0,0 +1,70 @@
1
+ export class ListController {
2
+ constructor(items: any, value: any, fields: any, options: any);
3
+ items: null;
4
+ fields: any;
5
+ mappers: any[];
6
+ selectedKeys: SvelteSet<any>;
7
+ focusedKey: null;
8
+ selected: null[];
9
+ focused: null | undefined;
10
+ data: {
11
+ key: string;
12
+ value: any;
13
+ }[];
14
+ lookup: Map<string, import("./proxy.svelte").Proxy>;
15
+ /**
16
+ * @private
17
+ * @param {Array<*>} items
18
+ * @param {*} value
19
+ */
20
+ private init;
21
+ get isNested(): boolean;
22
+ get currentKey(): null;
23
+ /**
24
+ * @private
25
+ * @param {*} value
26
+ * @returns
27
+ */
28
+ private findByValue;
29
+ /**
30
+ * @private
31
+ * @param {*} value
32
+ * @returns
33
+ */
34
+ private moveToValue;
35
+ /**
36
+ *
37
+ * @param {string} path
38
+ * @returns
39
+ */
40
+ moveTo(path: string): boolean;
41
+ /**
42
+ * @private
43
+ * @param {number} index
44
+ */
45
+ private moveToIndex;
46
+ movePrev(): boolean;
47
+ moveNext(): boolean;
48
+ moveFirst(): boolean;
49
+ moveLast(): boolean;
50
+ /**
51
+ * Toggles the selection.
52
+ * @private
53
+ * @param {string} key
54
+ */
55
+ private toggleSelection;
56
+ /**
57
+ *
58
+ * @param {string} selectedKey
59
+ * @returns
60
+ */
61
+ select(selectedKey: string): boolean;
62
+ /**
63
+ *
64
+ * @param {string} selectedKey
65
+ * @returns
66
+ */
67
+ extendSelection(selectedKey: string): boolean;
68
+ #private;
69
+ }
70
+ import { SvelteSet } from 'svelte/reactivity';
@@ -0,0 +1,32 @@
1
+ export class NestedController extends ListController {
2
+ /**
3
+ * @protected
4
+ * @param {Object} [value]
5
+ */
6
+ protected init(value?: Object): void;
7
+ /**
8
+ * Mark parents as expanded so that item is visible
9
+ * @param {*} value
10
+ * @returns
11
+ */
12
+ ensureVisible(value: any): boolean;
13
+ /**
14
+ * Toggle expansion of item
15
+ * @param {*} value
16
+ * @returns
17
+ */
18
+ toggleExpansion(key: any): boolean;
19
+ /**
20
+ * Expand item
21
+ * @param {*} value
22
+ * @returns
23
+ */
24
+ expand(key: any): boolean;
25
+ /**
26
+ * Collapse item
27
+ * @param {*} value
28
+ * @returns
29
+ */
30
+ collapse(key: any): boolean;
31
+ }
32
+ import { ListController } from './list-controller.svelte';
@@ -0,0 +1,43 @@
1
+ export class Proxy {
2
+ constructor(value: any, fields: any);
3
+ set fields(value: null);
4
+ get fields(): null;
5
+ set id(new_id: null);
6
+ get id(): null;
7
+ get children(): Proxy[];
8
+ set value(value: null);
9
+ get value(): null;
10
+ /**
11
+ * Gets a mapped attribute from the original item
12
+ *
13
+ * @param {string} fieldName - Name of the field to get
14
+ * @param {any} defaultValue - Default value to return if not found
15
+ * @returns {any|undefined} - The attribute value or null if not found
16
+ */
17
+ get(fieldName: string, defaultValue: any): any | undefined;
18
+ /**
19
+ * Checks if a mapped attribute exists in the original item
20
+ * @param {string} fieldName - Name of the field to check
21
+ * @returns boolean
22
+ */
23
+ has(fieldName: string): false | (<P extends PropertyKey>(s: P) => boolean);
24
+ /**
25
+ * Gets the appropriate snippet for rendering this item:
26
+ * - Uses the 'snippet' field from the current item to find the snippet key
27
+ * - Finds a matching snippet in the provided collection using this key
28
+ * - Falls back to the defaultSnippet if:
29
+ * - No snippet key is configured for this item
30
+ * - The configured snippet key doesn't exist in the snippets collection
31
+ * @param {Object} snippets
32
+ * @param {import('svelte').Snippet|undefined} defaultSnippet
33
+ * @returns {import('svelte').Snippet|undefined}
34
+ */
35
+ getSnippet(snippets: Object, defaultSnippet: import("svelte").Snippet | undefined): import("svelte").Snippet | undefined;
36
+ /**
37
+ * Identifies if the item has children
38
+ */
39
+ get hasChildren(): boolean;
40
+ set expanded(value: any);
41
+ get expanded(): any;
42
+ #private;
43
+ }
@@ -0,0 +1,5 @@
1
+ export class TableWrapper {
2
+ constructor(items: any);
3
+ data: null;
4
+ headers: any[];
5
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Handles navigation through a flattened data structure
3
+ */
4
+ export class Traversal {
5
+ /**
6
+ * @param {object} dataProvider - Data provider component
7
+ */
8
+ constructor(dataProvider: object);
9
+ /**
10
+ * Gets the current focused key
11
+ * @returns {string|null} The current key or null if none selected
12
+ */
13
+ get currentKey(): string | null;
14
+ /**
15
+ * Gets the current focused index
16
+ * @returns {number} The current index or -1 if none selected
17
+ */
18
+ get currentIndex(): number;
19
+ /**
20
+ * Gets the currently focused item
21
+ * @returns {object|null} The focused item or null
22
+ */
23
+ get focused(): object | null;
24
+ /**
25
+ * Calculates the current index based on the current key
26
+ * @private
27
+ * @returns {number} The current index or -1 if not found
28
+ */
29
+ private getCurrentIndex;
30
+ /**
31
+ * Focuses on an item by its key
32
+ * @param {string} key - Key of the item to focus
33
+ * @returns {boolean} True if focus changed, false otherwise
34
+ */
35
+ moveToKey(key: string): boolean;
36
+ /**
37
+ * Focuses on an item by its index in the flattened list
38
+ * @param {number} index - Index of the item to focus
39
+ * @returns {boolean} True if focus changed, false otherwise
40
+ */
41
+ moveToIndex(index: number): boolean;
42
+ /**
43
+ * Focuses on an item by finding its value in the data
44
+ * @param {*} value - Value to find and focus
45
+ * @returns {boolean} True if found and focused, false otherwise
46
+ */
47
+ moveToValue(value: any): boolean;
48
+ /**
49
+ * Moves focus to the previous visible item
50
+ * @returns {boolean} True if moved, false if at the beginning
51
+ */
52
+ movePrev(): boolean;
53
+ /**
54
+ * Moves focus to the next visible item
55
+ * @returns {boolean} True if moved, false if at the end
56
+ */
57
+ moveNext(): boolean;
58
+ /**
59
+ * Moves focus to the first item
60
+ * @returns {boolean} True if moved, false otherwise
61
+ */
62
+ moveFirst(): boolean;
63
+ /**
64
+ * Moves focus to the last item
65
+ * @returns {boolean} True if moved, false otherwise
66
+ */
67
+ moveLast(): boolean;
68
+ #private;
69
+ }