@maropost-ui/liquidsky-ui 0.1.44 → 0.1.45

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.
@@ -0,0 +1,31 @@
1
+ import type { StoryObj } from "@storybook/vue3";
2
+ /**
3
+ * Overrides Docs → “Show code” for Vue CSF stories that use a custom `render()` template.
4
+ *
5
+ * Storybook’s Vue renderer only reflects the primary component + flattened args there, so
6
+ * wrappers (`v-dialog`, layout, triggers, `v-bind="args"`) disappear unless you set source explicitly.
7
+ *
8
+ * Spread onto a story (or merge `parameters` if the story already defines docs):
9
+ *
10
+ * @example
11
+ * const canvasTemplate = `
12
+ * <div>
13
+ * <MyWidget v-bind="args" />
14
+ * </div>
15
+ * `;
16
+ *
17
+ * export const Default: Story = {
18
+ * ...vueStoryDocs(vueSfcDocsSnippet({ template: `...`, script: `...` })),
19
+ * render: ...
20
+ * };
21
+ */
22
+ export declare function vueStoryDocs(code: string): Pick<StoryObj, "parameters">;
23
+ /**
24
+ * Full SFC-shaped snippet for Docs → Show code (`<template>` + `<script setup>`).
25
+ * Use when readers need runnable context, not only the inner component tag.
26
+ */
27
+ export declare function vueSfcDocsSnippet(parts: {
28
+ template: string;
29
+ script: string;
30
+ }): string;
31
+ //# sourceMappingURL=vue-story-docs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vue-story-docs.d.ts","sourceRoot":"","sources":["../../../src/stories/helpers/vue-story-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,CAWvE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,MAAM,CAET"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Merges and deduplicates multiple arrays of objects structurally, without requiring a unique ID or key.
3
+ *
4
+ * Objects are compared deterministically by sorting their keys alphabetically. This ensures that
5
+ * objects with identical properties but different key orderings are accurately identified as duplicates.
6
+ *
7
+ * @template T - The type of elements in the array (defaults to `any`).
8
+ * @param {...any[][]} arrays - One or more arrays to be flattened and deduplicated.
9
+ * @returns {T[]} A new array containing only structurally unique items, cast to the expected type.
10
+ *
11
+ * @example
12
+ * // 1. Basic usage with mismatched key order
13
+ * const array1 = [{ role: 'admin', active: true }];
14
+ * const array2 = [{ active: true, role: 'admin' }, { role: 'user', active: false }];
15
+ *
16
+ * const unique = deduplicateObjects(array1, array2);
17
+ * // Output: [{ role: 'admin', active: true }, { role: 'user', active: false }]
18
+ *
19
+ * @example
20
+ * // 2. Handling nested objects and internal arrays
21
+ * const groupA = [{ user: { id: 1, tags: ['a', 'b'] } }];
22
+ * const groupB = [{ user: { tags: ['a', 'b'], id: 1 } }]; // nested keys reversed
23
+ *
24
+ * const uniqueNested = deduplicateObjects(groupA, groupB);
25
+ * // Output: [{ user: { id: 1, tags: ['a', 'b'] } }]
26
+ *
27
+ * @example
28
+ * // 3. Usage inside generic Vue/React hooks or composables
29
+ * function useDropdownData<T>(items: Ref<T[]>, initialData: T[]) {
30
+ * // Perfectly safe to call with unconstrained generic types
31
+ * const uniqueItems = deduplicateObjects<T>(items.value, initialData);
32
+ * return uniqueItems;
33
+ * }
34
+ */
35
+ export declare const deduplicateObjects: <T = any>(...arrays: any[][]) => T[];
36
+ //# sourceMappingURL=deduplicateObjects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deduplicateObjects.d.ts","sourceRoot":"","sources":["../../src/utils/deduplicateObjects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,GAAG,GAAG,EAAE,GAAG,QAAQ,GAAG,EAAE,EAAE,KAAG,CAAC,EA6BjE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maropost-ui/liquidsky-ui",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
4
4
  "description": "Shared UI components, composables, and utils for Vue + Vuetify",
5
5
  "main": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -45,8 +45,7 @@
45
45
  "date-fns-tz": "^3.2.0",
46
46
  "lz-string": "^1.5.0",
47
47
  "vue": "^3.5.11",
48
- "vue-router": "^4.4.5",
49
- "vuetify": "^3.7.13"
48
+ "vue-router": "^4.4.5"
50
49
  },
51
50
  "devDependencies": {
52
51
  "@mdi/font": "^7.4.47",
@@ -76,4 +75,4 @@
76
75
  "vue-tsc": "^3.0.5",
77
76
  "vuetify": "^3.9.5"
78
77
  }
79
- }
78
+ }