@mgdis/core-ui-helpers 1.2.2 → 1.3.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.
Files changed (149) hide show
  1. package/dist/angular/index.cjs +27 -0
  2. package/dist/angular/index.cjs.map +1 -0
  3. package/dist/angular/index.d.ts +21 -0
  4. package/dist/angular/index.js +25 -0
  5. package/dist/angular/index.js.map +1 -0
  6. package/dist/angular/index.umd.js +33 -0
  7. package/dist/angular/index.umd.js.map +1 -0
  8. package/dist/locale/index.cjs +190 -0
  9. package/dist/locale/index.cjs.map +1 -0
  10. package/dist/locale/index.d.ts +110 -0
  11. package/dist/locale/index.js +181 -0
  12. package/dist/locale/index.js.map +1 -0
  13. package/dist/locale/index.umd.js +196 -0
  14. package/dist/locale/index.umd.js.map +1 -0
  15. package/dist/playwright/index.cjs +137 -0
  16. package/dist/playwright/index.cjs.map +1 -0
  17. package/dist/playwright/index.d.ts +39 -0
  18. package/dist/playwright/index.js +133 -0
  19. package/dist/playwright/index.js.map +1 -0
  20. package/dist/playwright/index.umd.js +143 -0
  21. package/dist/playwright/index.umd.js.map +1 -0
  22. package/dist/stencil/index.cjs +363 -0
  23. package/dist/stencil/index.cjs.map +1 -0
  24. package/dist/stencil/index.d.ts +222 -0
  25. package/dist/stencil/index.js +357 -0
  26. package/dist/stencil/index.js.map +1 -0
  27. package/dist/stencil/index.umd.js +369 -0
  28. package/dist/stencil/index.umd.js.map +1 -0
  29. package/dist/storybook/index.cjs +2335 -0
  30. package/dist/storybook/index.cjs.map +1 -0
  31. package/dist/storybook/index.d.ts +85 -0
  32. package/dist/storybook/index.js +2329 -0
  33. package/dist/storybook/index.js.map +1 -0
  34. package/dist/storybook/index.umd.js +2341 -0
  35. package/dist/storybook/index.umd.js.map +1 -0
  36. package/dist/tests/index.cjs +315 -0
  37. package/dist/tests/index.cjs.map +1 -0
  38. package/dist/tests/index.d.ts +100 -0
  39. package/dist/tests/index.js +309 -0
  40. package/dist/tests/index.js.map +1 -0
  41. package/dist/tests/index.umd.js +321 -0
  42. package/dist/tests/index.umd.js.map +1 -0
  43. package/dist/utils/index.cjs +441 -0
  44. package/dist/utils/index.cjs.map +1 -0
  45. package/dist/utils/index.d.ts +265 -0
  46. package/dist/utils/index.js +417 -0
  47. package/dist/utils/index.js.map +1 -0
  48. package/dist/utils/index.umd.js +447 -0
  49. package/dist/utils/index.umd.js.map +1 -0
  50. package/dist/vue/index.cjs +1935 -0
  51. package/dist/vue/index.cjs.map +1 -0
  52. package/dist/vue/index.d.ts +35 -0
  53. package/dist/vue/index.js +1933 -0
  54. package/dist/vue/index.js.map +1 -0
  55. package/dist/vue/index.umd.js +1941 -0
  56. package/dist/vue/index.umd.js.map +1 -0
  57. package/package.json +4 -1
  58. package/CHANGELOG.md +0 -101
  59. package/json-doc.test.json +0 -264
  60. package/rollup.config.mjs +0 -61
  61. package/src/angular/index.spec.ts +0 -8
  62. package/src/angular/index.ts +0 -1
  63. package/src/angular/mg-angular-logger/index.ts +0 -1
  64. package/src/angular/mg-angular-logger/mg-angular-logger.conf.ts +0 -3
  65. package/src/angular/mg-angular-logger/mg-angular-logger.spec.ts +0 -40
  66. package/src/angular/mg-angular-logger/mg-angular-logger.ts +0 -24
  67. package/src/locale/index.spec.ts +0 -24
  68. package/src/locale/index.ts +0 -1
  69. package/src/locale/locale.spec.ts +0 -291
  70. package/src/locale/locale.ts +0 -201
  71. package/src/playwright/config/index.ts +0 -43
  72. package/src/playwright/index.spec.ts +0 -16
  73. package/src/playwright/index.ts +0 -4
  74. package/src/playwright/utils/__snapshots__/utils.spec.ts.snap +0 -48
  75. package/src/playwright/utils/index.ts +0 -1
  76. package/src/playwright/utils/utils.spec.ts +0 -50
  77. package/src/playwright/utils/utils.ts +0 -77
  78. package/src/stencil/ide/__snapshots__/cem.spec.ts.snap +0 -248
  79. package/src/stencil/ide/__snapshots__/ide.spec.ts.snap +0 -414
  80. package/src/stencil/ide/cem.spec.ts +0 -35
  81. package/src/stencil/ide/cem.ts +0 -96
  82. package/src/stencil/ide/ide.spec.ts +0 -29
  83. package/src/stencil/ide/ide.ts +0 -221
  84. package/src/stencil/ide/index.ts +0 -2
  85. package/src/stencil/index.spec.ts +0 -16
  86. package/src/stencil/index.ts +0 -2
  87. package/src/stencil/normalize-boolean-attributes/index.ts +0 -1
  88. package/src/stencil/normalize-boolean-attributes/normalize-boolean-attributes.spec.ts +0 -63
  89. package/src/stencil/normalize-boolean-attributes/normalize-boolean-attributes.ts +0 -40
  90. package/src/storybook/index.spec.ts +0 -19
  91. package/src/storybook/index.ts +0 -1
  92. package/src/storybook/stencil/__snapshots__/stencil.spec.ts.snap +0 -329
  93. package/src/storybook/stencil/index.ts +0 -1
  94. package/src/storybook/stencil/stencil-shim.d.ts +0 -1
  95. package/src/storybook/stencil/stencil.conf.ts +0 -4
  96. package/src/storybook/stencil/stencil.spec.ts +0 -170
  97. package/src/storybook/stencil/stencil.ts +0 -377
  98. package/src/tests/index.spec.ts +0 -20
  99. package/src/tests/index.ts +0 -1
  100. package/src/tests/unit/__snapshots__/unit.spec.ts.snap +0 -52
  101. package/src/tests/unit/index.ts +0 -1
  102. package/src/tests/unit/unit.conf.ts +0 -16
  103. package/src/tests/unit/unit.spec.ts +0 -206
  104. package/src/tests/unit/unit.ts +0 -333
  105. package/src/utils/attributes/class-list/class-list.spec.ts +0 -36
  106. package/src/utils/attributes/class-list/class-list.ts +0 -51
  107. package/src/utils/attributes/class-list/index.ts +0 -1
  108. package/src/utils/attributes/id/id.spec.ts +0 -54
  109. package/src/utils/attributes/id/id.ts +0 -47
  110. package/src/utils/attributes/id/index.ts +0 -1
  111. package/src/utils/attributes/index.ts +0 -3
  112. package/src/utils/attributes/to-kebab-case/index.ts +0 -1
  113. package/src/utils/attributes/to-kebab-case/to-kebab-case.spec.ts +0 -29
  114. package/src/utils/attributes/to-kebab-case/to-kebab-case.ts +0 -23
  115. package/src/utils/components/__snapshots__/components.spec.ts.snap +0 -313
  116. package/src/utils/components/components.conf.ts +0 -11
  117. package/src/utils/components/components.spec.ts +0 -192
  118. package/src/utils/components/components.ts +0 -152
  119. package/src/utils/components/index.ts +0 -2
  120. package/src/utils/date/date.spec.ts +0 -12
  121. package/src/utils/date/date.ts +0 -20
  122. package/src/utils/date/index.ts +0 -1
  123. package/src/utils/elements/elements.spec.ts +0 -17
  124. package/src/utils/elements/elements.ts +0 -18
  125. package/src/utils/elements/index.ts +0 -1
  126. package/src/utils/index.spec.ts +0 -84
  127. package/src/utils/index.ts +0 -8
  128. package/src/utils/number/index.ts +0 -1
  129. package/src/utils/number/number.spec.ts +0 -14
  130. package/src/utils/number/number.ts +0 -6
  131. package/src/utils/object/index.ts +0 -2
  132. package/src/utils/object/object.conf.ts +0 -4
  133. package/src/utils/object/object.spec.ts +0 -110
  134. package/src/utils/object/object.ts +0 -27
  135. package/src/utils/string/index.ts +0 -1
  136. package/src/utils/string/string.spec.ts +0 -54
  137. package/src/utils/string/string.ts +0 -39
  138. package/src/utils/windows/index.ts +0 -1
  139. package/src/utils/windows/windows.spec.ts +0 -69
  140. package/src/utils/windows/windows.ts +0 -50
  141. package/src/vue/index.spec.ts +0 -8
  142. package/src/vue/index.ts +0 -1
  143. package/src/vue/mg-model/index.ts +0 -1
  144. package/src/vue/mg-model/mg-model.conf.ts +0 -6
  145. package/src/vue/mg-model/mg-model.spec.ts +0 -50
  146. package/src/vue/mg-model/mg-model.ts +0 -55
  147. package/tsconfig.json +0 -17
  148. package/typedoc.json +0 -14
  149. package/vitest.config.mts +0 -13
@@ -0,0 +1,143 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.CoreUiHelpers = global.CoreUiHelpers || {}, global.CoreUiHelpers.playwright = {})));
5
+ })(this, (function (exports) { 'use strict';
6
+
7
+ const config = {
8
+ testMatch: '*.e2e.ts',
9
+ snapshotPathTemplate: '{testFileDir}/__screenshots__/{arg}-{projectName}{ext}',
10
+ /* Maximum time one test can run for. */
11
+ timeout: 30 * 1000,
12
+ expect: {
13
+ /**
14
+ * Maximum time expect() should wait for the condition to be met.
15
+ * For example in `await expect(locator).toHaveText();`
16
+ */
17
+ timeout: 5000,
18
+ /**
19
+ * Exact per-pixel colour (`threshold: 0`) so sub-perceptual shifts aren't hidden by the
20
+ * default 0.2; `maxDiffPixels: 100` tolerates anti-aliasing jitter but not a real fill.
21
+ */
22
+ toHaveScreenshot: { threshold: 0, maxDiffPixels: 100 },
23
+ },
24
+ /* Run tests in files in parallel */
25
+ fullyParallel: true,
26
+ /* Fail the build on CI if you accidentally left test.only in the source code. */
27
+ forbidOnly: !!process.env.CI,
28
+ /* Retry on CI only */
29
+ retries: process.env.CI ? 2 : 0,
30
+ /* Stop on CI on first failure */
31
+ maxFailures: process.env.CI ? 1 : 0,
32
+ /* Opt out of parallel tests on CI. */
33
+ workers: process.env.CI ? 1 : undefined,
34
+ /* Reporter to use. See https://playwright.dev/docs/test-reporters */
35
+ reporter: [
36
+ ['html', { open: 'never' }],
37
+ ['junit', { outputFile: 'results.xml' }],
38
+ ],
39
+ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
40
+ use: {
41
+ headless: true,
42
+ /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
43
+ actionTimeout: 0,
44
+ /* Base URL to use in actions like `await page.goto('/')`. */
45
+ // baseURL: 'http://localhost:3000',
46
+ /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
47
+ trace: 'on-first-retry',
48
+ },
49
+ };
50
+
51
+ /**
52
+ * Check if a value is of object type.
53
+ * @param object - The value to validate.
54
+ * @returns `true` if the value is a valid object (non-null and not an array), otherwise `false`.
55
+ */
56
+ const isObject = (object) => typeof object === 'object' && !Array.isArray(object) && object !== null;
57
+
58
+ /**
59
+ * Typeguard function to check if all array items are strings.
60
+ * @param items - items to check
61
+ * @returns `true` if all items are strings
62
+ */
63
+ /**
64
+ * Validate string
65
+ * @param value - value to check
66
+ * @returns `true` if string is valid
67
+ */
68
+ const isValidString = (value) => typeof value === 'string' && value.trim() !== '';
69
+
70
+ /**
71
+ * Render attributes from props objects.
72
+ *
73
+ * Booleans follow the HTML spec for boolean attributes: `true` emits an empty-value attribute
74
+ * (presence implies `true`), `false` omits the attribute entirely. This matches the behaviour
75
+ * of the `normalizeBooleanAttributes` Stencil helper.
76
+ * @param args - argument to render as string. ex: `{status: 'visible'}`
77
+ * @returns formated inline attributed. ex: 'status="visible"'
78
+ * @example
79
+ * ```ts
80
+ * import { renderAttributes } from '@mgdis/core-ui-helpers/dist/playwright';
81
+ *
82
+ * const attributes = renderAttributes({ status: 'visible', color: 'red', disabled: true, readonly: false });
83
+ * console.log(attributes); // Output: 'status="visible" color="red" disabled=""'
84
+ * ```
85
+ */
86
+ const renderAttributes = (args) => (isObject(args) &&
87
+ Object.keys(args)
88
+ .filter((key) => ![null, undefined].includes(args[key]) &&
89
+ !['object', 'function'].includes(typeof args[key]) &&
90
+ args[key] !== false)
91
+ .map((key) => {
92
+ const attribute = key.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
93
+ if (args[key] === true)
94
+ return `${attribute}=""`;
95
+ const value = typeof args[key] === 'number' || isValidString(args[key]) ? String(args[key]).replace(/"/g, "'") : '';
96
+ return `${attribute}="${value}"`;
97
+ })
98
+ .join(' ')) ||
99
+ '';
100
+ /**
101
+ * Render properties from props objects.
102
+ * Insert return value in <script></script> element
103
+ * @param args - argument to render as script. ex: `{status: 'visible'}`
104
+ * @param selector - querySelector get targetted element and bind properties on it
105
+ * @returns stringified properties script
106
+ * @example
107
+ * ```ts
108
+ * import { renderProperties } from '@mgdis/core-ui-helpers/dist/playwright';
109
+ *
110
+ * const propertiesScript = renderProperties({ status: 'visible', color: 'red' }, '.targetElement');
111
+ * console.log(propertiesScript);
112
+ * // Output: 'document.querySelector(".targetElement").status="visible"; document.querySelector(".targetElement").color="red";'
113
+ * ```
114
+ */
115
+ const renderProperties = (args, selector) => {
116
+ // has generated id selector starting with "#" create charcters (ex: '#0j3xzw4w7m') make test crashed sometime with "querySelector"
117
+ // we use "getElementById" document query
118
+ const query = selector.startsWith('#') ? 'getElementById' : 'querySelector';
119
+ if (query === 'getElementById')
120
+ selector = selector.replace('#', '');
121
+ return args !== null && typeof args === 'object' && Object.keys(args).length > 0
122
+ ? `
123
+ ${Object.keys(args)
124
+ .filter((key) => ['object', 'function'].includes(typeof args[key]))
125
+ .map((key) => {
126
+ const value = JSON.stringify(args[key], (_key, val) => typeof val === 'function' ? `<fn>${val}</fn>` : val);
127
+ return `document.${query}('${selector}').${key}=${value}`;
128
+ }) // stringify json AND keep function values
129
+ .join(';') // create string
130
+ .split('"<fn>') // remove fn start decorator
131
+ .join('')
132
+ .split('</fn>"')
133
+ .join('') // remove fn end decorator
134
+ };`
135
+ : '';
136
+ };
137
+
138
+ exports.playwrightBaseConfig = config;
139
+ exports.renderAttributes = renderAttributes;
140
+ exports.renderProperties = renderProperties;
141
+
142
+ }));
143
+ //# sourceMappingURL=index.umd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.umd.js","sources":["../../src/playwright/config/index.ts","../../src/utils/object/object.ts","../../src/utils/string/string.ts","../../src/playwright/utils/utils.ts"],"sourcesContent":[null,null,null,null],"names":[],"mappings":";;;;;;AAEA,UAAM,MAAM,GAAyB;IACnC,IAAA,SAAS,EAAE,UAAU;IACrB,IAAA,oBAAoB,EAAE,wDAAwD;;QAE9E,OAAO,EAAE,EAAE,GAAG,IAAI;IAClB,IAAA,MAAM,EAAE;IACN;;;IAGG;IACH,QAAA,OAAO,EAAE,IAAI;IACb;;;IAGG;YACH,gBAAgB,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE;IACvD,KAAA;;IAED,IAAA,aAAa,EAAE,IAAI;;IAEnB,IAAA,UAAU,EAAE,CAAC,CAAC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,IAA8B,CAAC,GAAG,CAAC,CAAC;AAC5F,aAAA,GAAG,CAAC,CAAC,GAAG,KAAI;AACX,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAE,IAA8B,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAC3E,OAAO,GAAG,KAAK,UAAU,GAAG,CAAA,IAAA,EAAO,GAAG,OAAO,GAAG,GAAG,CACpD;YACD,OAAO,CAAA,SAAA,EAAY,KAAK,CAAA,EAAA,EAAK,QAAQ,MAAM,GAAG,CAAA,CAAA,EAAI,KAAK,CAAA,CAAE;QAC3D,CAAC,CAAC;AACD,aAAA,IAAI,CAAC,GAAG,CAAC;AACT,aAAA,KAAK,CAAC,OAAO,CAAC;aACd,IAAI,CAAC,EAAE;aACP,KAAK,CAAC,QAAQ;AACd,aAAA,IAAI,CAAC,EAAE,CAAC;SACb,CAAA;cACI,EAAE;IACR;;;;;;;;;;"}
@@ -0,0 +1,363 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Retrieve Component Storybook URL from file path
5
+ * @param storybookBaseUrl - Storybook Base URL
6
+ * @param filePath - Component file path
7
+ * @returns Component Storybook URL
8
+ */
9
+ const getStorybookUrl = (storybookBaseUrl, filePath) => {
10
+ if (!filePath) {
11
+ return;
12
+ }
13
+ const split = filePath.split('/');
14
+ return `${storybookBaseUrl}${split.slice(2, split.length - 1).join('-')}--docs`;
15
+ };
16
+
17
+ /**
18
+ * Retrieve Component source URL from file path
19
+ * @param sourcesBaseUrl - Source base URL
20
+ * @param filePath - Component file path
21
+ * @returns Component source URL
22
+ */
23
+ const getSourcesUrl = (sourcesBaseUrl, filePath) => {
24
+ if (!filePath) {
25
+ return;
26
+ }
27
+ return `${sourcesBaseUrl}${filePath}`;
28
+ };
29
+ /**
30
+ * Get Component element description.
31
+ *
32
+ * Neither WebStorm nor VS Code render the structured `attributes` /
33
+ * `js.properties` arrays in the tag-level quick-doc — they only show this
34
+ * markdown description. So the attribute and property listings have to live
35
+ * here, even though they're redundant with the structured arrays used by the
36
+ * inline autocomplete.
37
+ * @param component - Component
38
+ * @returns Component element description
39
+ */
40
+ const getElementDescription = (component) => {
41
+ let description = component.overview ? `${component.overview}\n\n` : '';
42
+ const attributes = component.props.filter(({ attr }) => attr !== undefined);
43
+ if (attributes.length) {
44
+ description += `Attributes:\n`;
45
+ description += attributes.map(({ attr, docs }) => `- \`${attr}\`: ${docs}\n`).join('');
46
+ description += '\n';
47
+ }
48
+ const properties = component.props.filter(({ attr }) => attr === undefined);
49
+ if (properties.length) {
50
+ description += `Properties:\n`;
51
+ description += properties.map(({ name, docs }) => `- \`${name}\`: ${docs}\n`).join('');
52
+ description += '\n';
53
+ }
54
+ if (component.methods.length) {
55
+ description += `Methods:\n`;
56
+ description += component.methods.map(({ name, docs }) => `- \`${name}\`: ${docs}\n`).join('');
57
+ description += '\n';
58
+ }
59
+ if (component.events.length) {
60
+ description += `Events:\n`;
61
+ description += component.events.map(({ event, docs }) => `- \`${event}\`: ${docs}\n`).join('');
62
+ description += '\n';
63
+ }
64
+ if (component.listeners.length) {
65
+ description += `Listeners:\n`;
66
+ description += component.listeners.map(({ event }) => `- \`${event}\`\n`).join('');
67
+ description += '\n';
68
+ }
69
+ if (component.slots.length) {
70
+ description += `Slots:\n`;
71
+ description += component.slots
72
+ .map(({ name, docs }) => {
73
+ const label = name ? `\`${name}\`` : 'default';
74
+ return `- ${label}: ${docs}\n`;
75
+ })
76
+ .join('');
77
+ description += '\n';
78
+ }
79
+ return description;
80
+ };
81
+ /**
82
+ * Get Props Description
83
+ * @param prop - Component Property
84
+ * @returns Props Description
85
+ */
86
+ const getAttributeDescription = (prop) => {
87
+ return `${prop.docs}\n\nType: \`${prop.type}\``;
88
+ };
89
+ /**
90
+ * Generate Web Types metadata for IntelliJ's IDE
91
+ * @param name - Library name
92
+ * @param version - Library version
93
+ * @param jsonDocs - Stencil JSON doc
94
+ * @param storybookBaseUrl - Storybook Base Url
95
+ * @returns Web Types metadata
96
+ * @example
97
+ * ```ts
98
+ * const webTypesJson = webTypesGenerator('@mgdis/mg-components', '1.0.0', jsonDocs, 'https://storybook.example.com');
99
+ * ```
100
+ */
101
+ const webTypesGenerator = (name, version, jsonDocs, storybookBaseUrl) => ({
102
+ $schema: 'https://json.schemastore.org/web-types',
103
+ name,
104
+ version,
105
+ 'description-markup': 'markdown',
106
+ contributions: {
107
+ html: {
108
+ elements: jsonDocs.components.map((component) => {
109
+ const docUrl = getStorybookUrl(storybookBaseUrl, component.filePath);
110
+ return {
111
+ name: component.tag,
112
+ description: getElementDescription(component),
113
+ 'doc-url': docUrl,
114
+ attributes: component.props
115
+ .filter((prop) => prop.attr)
116
+ .map((prop) => ({
117
+ name: prop.attr,
118
+ description: getAttributeDescription(prop),
119
+ 'doc-url': docUrl,
120
+ value: {
121
+ type: prop.type,
122
+ default: prop.default,
123
+ required: prop.required,
124
+ },
125
+ })),
126
+ js: {
127
+ properties: component.props
128
+ .filter((prop) => prop.attr === undefined)
129
+ .map((prop) => ({
130
+ name: prop.name,
131
+ description: getAttributeDescription(prop),
132
+ 'doc-url': docUrl,
133
+ value: {
134
+ type: prop.type,
135
+ default: prop.default,
136
+ required: prop.required,
137
+ },
138
+ })),
139
+ events: component.events.map((event) => ({
140
+ name: event.event,
141
+ description: event.docs,
142
+ })),
143
+ },
144
+ css: {
145
+ properties: component.styles.map((style) => ({
146
+ name: style.name,
147
+ description: style.docs,
148
+ })),
149
+ },
150
+ };
151
+ }),
152
+ },
153
+ },
154
+ });
155
+ /**
156
+ * Create Storybook Reference
157
+ * @param storybookBaseUrl - Storybook Base Url
158
+ * @param filePath - Component file path
159
+ * @returns Storybook Reference
160
+ */
161
+ const getReferences = (storybookBaseUrl, sourceBaseUrl, filePath) => {
162
+ return [
163
+ { name: 'Storybook', url: getStorybookUrl(storybookBaseUrl, filePath) },
164
+ { name: 'Sources', url: getSourcesUrl(sourceBaseUrl, filePath) },
165
+ ];
166
+ };
167
+ /**
168
+ * Get Property possible values
169
+ * @param prop - Component Property
170
+ * @returns Property possible values
171
+ */
172
+ const getValues = (prop) => {
173
+ // Only values Array where all objects have a value seems to be usefull
174
+ if (prop.values.some(({ value }) => value === undefined)) {
175
+ return;
176
+ }
177
+ return prop.values.map(({ value }) => ({ name: value }));
178
+ };
179
+ /**
180
+ * Generate custom HTML datasets for VS Code
181
+ * @param jsonDocs - Stencil JSON doc
182
+ * @param storybookBaseUrl - Storybook Base Url
183
+ * @returns custom HTML datasets
184
+ * @example
185
+ * ```ts
186
+ * const customDataJson = vsCodeGenerator(jsonDocs, 'https://storybook.example.com', 'https://sources.example.com');
187
+ * ```
188
+ */
189
+ const vsCodeGenerator = (jsonDocs, storybookBaseUrl, sourceBaseUrl) => ({
190
+ version: 1.1,
191
+ tags: jsonDocs.components.map((component) => {
192
+ const references = getReferences(storybookBaseUrl, sourceBaseUrl, component.filePath);
193
+ return {
194
+ name: component.tag,
195
+ description: getElementDescription(component),
196
+ attributes: component.props
197
+ .filter((prop) => prop.attr !== undefined)
198
+ .map((prop) => ({
199
+ name: prop.attr,
200
+ description: getAttributeDescription(prop),
201
+ values: getValues(prop),
202
+ references,
203
+ })),
204
+ references,
205
+ };
206
+ }),
207
+ globalAttributes: [],
208
+ valueSets: [],
209
+ });
210
+ /**
211
+ * Generate custom CSS datasets for VS Code
212
+ * @param jsonDocs - Stencil JSON doc
213
+ * @returns custom CSS datasets
214
+ * @example
215
+ * ```ts
216
+ * const customDataJson = vsCodeCssGenerator(jsonDocs);
217
+ * ```
218
+ */
219
+ const vsCodeCssGenerator = (jsonDocs) => ({
220
+ version: 1.1,
221
+ properties: jsonDocs.components.flatMap((component) => component.styles.map((style) => ({
222
+ name: style.name,
223
+ description: style.docs,
224
+ }))),
225
+ });
226
+
227
+ /**
228
+ * Convert a Stencil component's JsonDocs into a CEM v2 module entry.
229
+ * @param component - Stencil component doc
230
+ * @returns CEM module
231
+ */
232
+ const componentToModule = (component) => {
233
+ const className = component.tag
234
+ .split('-')
235
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
236
+ .join('');
237
+ const attributes = component.props
238
+ .filter((prop) => prop.attr !== undefined)
239
+ .map((prop) => ({
240
+ name: prop.attr,
241
+ description: prop.docs,
242
+ type: { text: prop.type },
243
+ ...(prop.default !== undefined && { default: prop.default }),
244
+ fieldName: prop.name,
245
+ }));
246
+ const fieldMembers = component.props.map((prop) => ({
247
+ kind: 'field',
248
+ name: prop.name,
249
+ description: prop.docs,
250
+ type: { text: prop.type },
251
+ ...(prop.default !== undefined && { default: prop.default }),
252
+ ...(prop.attr !== undefined && { attribute: prop.attr }),
253
+ }));
254
+ const methodMembers = component.methods.map((method) => ({
255
+ kind: 'method',
256
+ name: method.name,
257
+ description: method.docs,
258
+ }));
259
+ return {
260
+ kind: 'javascript-module',
261
+ path: component.filePath ?? '',
262
+ declarations: [
263
+ {
264
+ kind: 'class',
265
+ name: className,
266
+ tagName: component.tag,
267
+ customElement: true,
268
+ description: component.overview ?? '',
269
+ attributes,
270
+ members: [...fieldMembers, ...methodMembers],
271
+ events: component.events.map((event) => ({
272
+ name: event.event,
273
+ description: event.docs,
274
+ type: { text: `CustomEvent<${event.detail}>` },
275
+ })),
276
+ slots: component.slots.map((slot) => ({
277
+ name: slot.name,
278
+ description: slot.docs,
279
+ })),
280
+ cssProperties: component.styles.map((style) => ({
281
+ name: style.name,
282
+ description: style.docs,
283
+ })),
284
+ cssParts: component.parts.map((part) => ({
285
+ name: part.name,
286
+ description: part.docs,
287
+ })),
288
+ },
289
+ ],
290
+ exports: [
291
+ {
292
+ kind: 'custom-element-definition',
293
+ name: component.tag,
294
+ declaration: {
295
+ name: className,
296
+ module: component.filePath ?? '',
297
+ },
298
+ },
299
+ ],
300
+ };
301
+ };
302
+ /**
303
+ * Generate a Custom Elements Manifest v2 from Stencil JSON docs.
304
+ * @param jsonDocs - Stencil JSON doc
305
+ * @returns CEM v2
306
+ * @example
307
+ * ```ts
308
+ * const cem = cemGenerator(jsonDocs);
309
+ * ```
310
+ */
311
+ const cemGenerator = (jsonDocs) => ({
312
+ schemaVersion: '2.0.0',
313
+ readme: '',
314
+ modules: jsonDocs.components.map(componentToModule),
315
+ });
316
+
317
+ /**
318
+ * Per the HTML spec, a boolean attribute is `true` whenever it is present on the
319
+ * element, regardless of its value (including `="false"`). Stencil's default Prop
320
+ * parser converts the string `"false"` to the boolean `false`, which breaks this
321
+ * contract for consumers writing markup. Call this helper from `componentWillLoad`
322
+ * to re-normalize every present attribute that maps to a boolean-typed Prop.
323
+ *
324
+ * Iterates the host element's attributes and, for each one whose camelCase name
325
+ * matches a `typeof === 'boolean'` Prop on the instance, rewrites the attribute
326
+ * to `''` — Stencil's parser then turns that into `true` via the standard
327
+ * attribute → prop pipeline (no need for `mutable: true` on the Prop, since the
328
+ * write goes through Stencil's internal setter, not through user code).
329
+ *
330
+ * Non-boolean Props and non-Prop attributes (`class`, `id`, ...) are skipped
331
+ * naturally by the type check.
332
+ *
333
+ * @param target - the component instance (must expose `element` via `@Element()`)
334
+ *
335
+ * @example
336
+ * ```typescript
337
+ * @Component({ tag: 'my-input' })
338
+ * export class MyInput {
339
+ * @Element() element: HTMLMyInputElement;
340
+ * @Prop() readonly = false;
341
+ * @Prop() disabled = false;
342
+ *
343
+ * componentWillLoad() {
344
+ * normalizeBooleanAttributes(this);
345
+ * }
346
+ * }
347
+ * ```
348
+ */
349
+ const normalizeBooleanAttributes = (target) => {
350
+ for (const attr of Array.from(target.element.attributes)) {
351
+ const propName = attr.name.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
352
+ if (typeof target[propName] === 'boolean') {
353
+ target.element.setAttribute(attr.name, '');
354
+ }
355
+ }
356
+ };
357
+
358
+ exports.cemGenerator = cemGenerator;
359
+ exports.normalizeBooleanAttributes = normalizeBooleanAttributes;
360
+ exports.vsCodeCssGenerator = vsCodeCssGenerator;
361
+ exports.vsCodeGenerator = vsCodeGenerator;
362
+ exports.webTypesGenerator = webTypesGenerator;
363
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../src/storybook/stencil/stencil.ts","../../src/stencil/ide/ide.ts","../../src/stencil/ide/cem.ts","../../src/stencil/normalize-boolean-attributes/normalize-boolean-attributes.ts"],"sourcesContent":[null,null,null,null],"names":[],"mappings":";;AA6JA;;;;;AAKG;AACI,MAAM,eAAe,GAAG,CAAC,gBAAwB,EAAE,QAA4B,KAAwB;IAC5G,IAAI,CAAC,QAAQ,EAAE;QACb;IACF;IACA,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC;IACjC,OAAO,CAAA,EAAG,gBAAgB,CAAA,EAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,MAAA,CAAQ;AACjF,CAAC;;ACtKD;;;;;AAKG;AACH,MAAM,aAAa,GAAG,CAAC,cAAsB,EAAE,QAA4B,KAAwB;IACjG,IAAI,CAAC,QAAQ,EAAE;QACb;IACF;AACA,IAAA,OAAO,CAAA,EAAG,cAAc,CAAA,EAAG,QAAQ,EAAE;AACvC,CAAC;AAED;;;;;;;;;;AAUG;AACH,MAAM,qBAAqB,GAAG,CAAC,SAA4B,KAAY;AACrE,IAAA,IAAI,WAAW,GAAG,SAAS,CAAC,QAAQ,GAAG,CAAA,EAAG,SAAS,CAAC,QAAQ,CAAA,IAAA,CAAM,GAAG,EAAE;AACvE,IAAA,MAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,IAAI,KAAK,SAAS,CAAC;AAC3E,IAAA,IAAI,UAAU,CAAC,MAAM,EAAE;QACrB,WAAW,IAAI,eAAe;QAC9B,WAAW,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAA,IAAA,EAAO,IAAI,CAAA,IAAA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