storybook-addon-sdc 0.2.7 → 0.2.8
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/exBuilderSchema.yml +225 -0
- package/dist/preset.js +25 -9
- package/package.json +1 -1
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
json-schema-definitions://experience_builder.module/textarea:
|
|
2
|
+
title: 'Multi-line string'
|
|
3
|
+
type: 'string'
|
|
4
|
+
json-schema-definitions://experience_builder.module/heading-element:
|
|
5
|
+
title: 'Heading element'
|
|
6
|
+
type: 'string'
|
|
7
|
+
enum:
|
|
8
|
+
- 'div'
|
|
9
|
+
- 'h1'
|
|
10
|
+
- 'h2'
|
|
11
|
+
- 'h3'
|
|
12
|
+
- 'h4'
|
|
13
|
+
- 'h5'
|
|
14
|
+
- 'h6'
|
|
15
|
+
json-schema-definitions://experience_builder.module/column-width:
|
|
16
|
+
title: 'Column Width'
|
|
17
|
+
type: 'integer'
|
|
18
|
+
enum:
|
|
19
|
+
- '25'
|
|
20
|
+
- '33'
|
|
21
|
+
- '50'
|
|
22
|
+
- '66'
|
|
23
|
+
- '75'
|
|
24
|
+
json-schema-definitions://experience_builder.module/background-color:
|
|
25
|
+
title: 'Background Color'
|
|
26
|
+
type: 'string'
|
|
27
|
+
enum:
|
|
28
|
+
- ''
|
|
29
|
+
- 'primary'
|
|
30
|
+
- 'secondary'
|
|
31
|
+
- 'white'
|
|
32
|
+
json-schema-definitions://experience_builder.module/date-range:
|
|
33
|
+
title: 'date range'
|
|
34
|
+
type: 'object'
|
|
35
|
+
required:
|
|
36
|
+
- 'from'
|
|
37
|
+
- 'to'
|
|
38
|
+
properties:
|
|
39
|
+
from:
|
|
40
|
+
title: 'Start date'
|
|
41
|
+
type: 'string'
|
|
42
|
+
format: 'date'
|
|
43
|
+
to:
|
|
44
|
+
title: 'End date'
|
|
45
|
+
type: 'string'
|
|
46
|
+
format: 'date'
|
|
47
|
+
json-schema-definitions://experience_builder.module/stream-wrapper-uri:
|
|
48
|
+
title: 'Stream wrapper URI'
|
|
49
|
+
type: 'string'
|
|
50
|
+
format: 'uri'
|
|
51
|
+
json-schema-definitions://experience_builder.module/stream-wrapper-image-uri:
|
|
52
|
+
title: 'Stream wrapper image URI'
|
|
53
|
+
type: 'string'
|
|
54
|
+
format: 'uri'
|
|
55
|
+
json-schema-definitions://experience_builder.module/image-uri:
|
|
56
|
+
title: 'Image URL'
|
|
57
|
+
type: 'string'
|
|
58
|
+
format: 'uri-reference'
|
|
59
|
+
json-schema-definitions://experience_builder.module/heading:
|
|
60
|
+
title: 'Heading'
|
|
61
|
+
type: 'object'
|
|
62
|
+
required:
|
|
63
|
+
- 'text'
|
|
64
|
+
- 'element'
|
|
65
|
+
properties:
|
|
66
|
+
text:
|
|
67
|
+
type: 'string'
|
|
68
|
+
title: 'Text'
|
|
69
|
+
description: 'The heading text.'
|
|
70
|
+
examples:
|
|
71
|
+
- 'A heading element'
|
|
72
|
+
style:
|
|
73
|
+
type: 'string'
|
|
74
|
+
title: 'Style'
|
|
75
|
+
description: 'The heading style to use.'
|
|
76
|
+
enum:
|
|
77
|
+
- 'primary'
|
|
78
|
+
- 'secondary'
|
|
79
|
+
examples:
|
|
80
|
+
- 'primary'
|
|
81
|
+
- 'secondary'
|
|
82
|
+
element:
|
|
83
|
+
type: 'string'
|
|
84
|
+
title: 'Element'
|
|
85
|
+
description: 'The HTML element to use.'
|
|
86
|
+
enum:
|
|
87
|
+
- 'div'
|
|
88
|
+
- 'h1'
|
|
89
|
+
- 'h2'
|
|
90
|
+
- 'h3'
|
|
91
|
+
- 'h4'
|
|
92
|
+
- 'h5'
|
|
93
|
+
- 'h6'
|
|
94
|
+
examples:
|
|
95
|
+
- 'h1'
|
|
96
|
+
- 'h2'
|
|
97
|
+
- 'h3'
|
|
98
|
+
- 'h4'
|
|
99
|
+
- 'h5'
|
|
100
|
+
- 'h6'
|
|
101
|
+
- 'div'
|
|
102
|
+
json-schema-definitions://experience_builder.module/text:
|
|
103
|
+
title: 'Text'
|
|
104
|
+
type: 'object'
|
|
105
|
+
properties:
|
|
106
|
+
text:
|
|
107
|
+
type: 'string'
|
|
108
|
+
title: 'Text'
|
|
109
|
+
description: 'The text to display.'
|
|
110
|
+
examples:
|
|
111
|
+
- 'This is some text'
|
|
112
|
+
json-schema-definitions://experience_builder.module/shoe-icon:
|
|
113
|
+
title: 'Icon'
|
|
114
|
+
type: 'object'
|
|
115
|
+
properties:
|
|
116
|
+
name:
|
|
117
|
+
type: 'string'
|
|
118
|
+
title: 'Name'
|
|
119
|
+
description: 'The badge’s theme variant.'
|
|
120
|
+
default: 'primary'
|
|
121
|
+
enum:
|
|
122
|
+
- 'moon-stars-fill'
|
|
123
|
+
- 'moon-stars'
|
|
124
|
+
- 'star-fill'
|
|
125
|
+
- 'star'
|
|
126
|
+
- 'stars'
|
|
127
|
+
- 'rocket-fill'
|
|
128
|
+
- 'rocket-takeoff-fill'
|
|
129
|
+
- 'rocket-takeoff'
|
|
130
|
+
- 'rocket'
|
|
131
|
+
examples:
|
|
132
|
+
- 'moon-stars-fill'
|
|
133
|
+
- 'moon-stars'
|
|
134
|
+
- 'star-fill'
|
|
135
|
+
- 'star'
|
|
136
|
+
- 'stars'
|
|
137
|
+
- 'rocket-fill'
|
|
138
|
+
- 'rocket-takeoff-fill'
|
|
139
|
+
- 'rocket-takeoff'
|
|
140
|
+
- 'rocket'
|
|
141
|
+
label:
|
|
142
|
+
type: 'string'
|
|
143
|
+
title: 'Label'
|
|
144
|
+
description: 'An alternate description to use for assistive devices. If omitted, the icon will be considered presentational and ignored by assistive devices.'
|
|
145
|
+
default: 'This is an icon'
|
|
146
|
+
examples:
|
|
147
|
+
- 'This is an icon'
|
|
148
|
+
size:
|
|
149
|
+
type: 'string'
|
|
150
|
+
title: 'Size'
|
|
151
|
+
description: 'The icon size.'
|
|
152
|
+
default: ''
|
|
153
|
+
enum:
|
|
154
|
+
- ''
|
|
155
|
+
- 'base'
|
|
156
|
+
- 'l'
|
|
157
|
+
- 's'
|
|
158
|
+
- 'xs'
|
|
159
|
+
- 'xxs'
|
|
160
|
+
examples:
|
|
161
|
+
- ''
|
|
162
|
+
- 'base'
|
|
163
|
+
- 'l'
|
|
164
|
+
- 's'
|
|
165
|
+
- 'xs'
|
|
166
|
+
- 'xxs'
|
|
167
|
+
color:
|
|
168
|
+
type: 'string'
|
|
169
|
+
title: 'Color'
|
|
170
|
+
description: 'The icon color'
|
|
171
|
+
default: ''
|
|
172
|
+
enum:
|
|
173
|
+
- ''
|
|
174
|
+
- 'gray'
|
|
175
|
+
- 'primary'
|
|
176
|
+
- 'neutral-soft'
|
|
177
|
+
- 'neutral-medium'
|
|
178
|
+
- 'neutral-loud'
|
|
179
|
+
- 'primary-medium'
|
|
180
|
+
- 'primary-loud'
|
|
181
|
+
- 'black'
|
|
182
|
+
- 'white'
|
|
183
|
+
- 'red'
|
|
184
|
+
- 'gold'
|
|
185
|
+
- 'green'
|
|
186
|
+
examples:
|
|
187
|
+
- ''
|
|
188
|
+
- 'gray'
|
|
189
|
+
- 'primary'
|
|
190
|
+
- 'neutral-soft'
|
|
191
|
+
- 'neutral-medium'
|
|
192
|
+
- 'neutral-loud'
|
|
193
|
+
- 'primary-medium'
|
|
194
|
+
- 'primary-loud'
|
|
195
|
+
- 'black'
|
|
196
|
+
- 'white'
|
|
197
|
+
- 'red'
|
|
198
|
+
- 'gold'
|
|
199
|
+
- 'green'
|
|
200
|
+
slot:
|
|
201
|
+
type: 'string'
|
|
202
|
+
title: 'Slot'
|
|
203
|
+
description: 'The slot the icon should appear in'
|
|
204
|
+
examples:
|
|
205
|
+
json-schema-definitions://experience_builder.module/image:
|
|
206
|
+
title: 'image'
|
|
207
|
+
type: 'object'
|
|
208
|
+
required:
|
|
209
|
+
- 'src'
|
|
210
|
+
properties:
|
|
211
|
+
src:
|
|
212
|
+
title: 'Image URL'
|
|
213
|
+
$ref: json-schema-definitions://experience_builder.module/image-uri
|
|
214
|
+
alt:
|
|
215
|
+
title: 'Alternative text'
|
|
216
|
+
type: 'string'
|
|
217
|
+
width:
|
|
218
|
+
title: 'Image width'
|
|
219
|
+
type: 'integer'
|
|
220
|
+
height:
|
|
221
|
+
title: 'Image height'
|
|
222
|
+
type: 'integer'
|
|
223
|
+
json-schema-definitions://experience_builder.module/config-entity-id:
|
|
224
|
+
title: 'config entity id'
|
|
225
|
+
type: 'string'
|
package/dist/preset.js
CHANGED
|
@@ -5484,7 +5484,7 @@ init_esm_shims();
|
|
|
5484
5484
|
// src/vite-plugin-storybook-yaml-stories.ts
|
|
5485
5485
|
init_esm_shims();
|
|
5486
5486
|
var import_yaml2 = __toESM(require_yaml(), 1);
|
|
5487
|
-
import { readdirSync, readFileSync as readFileSync2, existsSync } from "fs";
|
|
5487
|
+
import { readdirSync, readFileSync as readFileSync2, existsSync as existsSync2 } from "fs";
|
|
5488
5488
|
import { dirname as dirname2, extname, join, resolve as resolve2 } from "path";
|
|
5489
5489
|
|
|
5490
5490
|
// src/argsGenerator.ts
|
|
@@ -5573,13 +5573,29 @@ var generateComponent = (item) => {
|
|
|
5573
5573
|
// src/customRefsTransform.ts
|
|
5574
5574
|
init_esm_shims();
|
|
5575
5575
|
var import_yaml = __toESM(require_yaml(), 1);
|
|
5576
|
-
import { readFileSync } from "node:fs";
|
|
5576
|
+
import { readFileSync, existsSync } from "node:fs";
|
|
5577
5577
|
import { resolve } from "node:path";
|
|
5578
|
-
var
|
|
5579
|
-
|
|
5580
|
-
)
|
|
5578
|
+
var loadYamlFile = (filePath) => {
|
|
5579
|
+
const resolvedPath = resolve(__dirname, filePath);
|
|
5580
|
+
if (!existsSync(resolvedPath)) {
|
|
5581
|
+
throw new Error(`File not found: ${resolvedPath}`);
|
|
5582
|
+
}
|
|
5583
|
+
return (0, import_yaml.parse)(readFileSync(resolvedPath, "utf8"));
|
|
5584
|
+
};
|
|
5585
|
+
var uiPatternsSchema = loadYamlFile("../drupal-defs/uiPatternsSchema.yml");
|
|
5586
|
+
var additionalSchema = loadYamlFile("../drupal-defs/exBuilderSchema.yml");
|
|
5587
|
+
var customDefs = {
|
|
5588
|
+
...uiPatternsSchema,
|
|
5589
|
+
...additionalSchema
|
|
5590
|
+
};
|
|
5581
5591
|
var customRefsTransform_default = (schema) => {
|
|
5582
|
-
return {
|
|
5592
|
+
return {
|
|
5593
|
+
...schema,
|
|
5594
|
+
$defs: {
|
|
5595
|
+
...customDefs,
|
|
5596
|
+
...schema.$defs
|
|
5597
|
+
}
|
|
5598
|
+
};
|
|
5583
5599
|
};
|
|
5584
5600
|
|
|
5585
5601
|
// src/componentMetadata.ts
|
|
@@ -5604,7 +5620,7 @@ var resolveComponentPath = (namespace, component) => {
|
|
|
5604
5620
|
const possiblePaths = directories.map(
|
|
5605
5621
|
(dir) => join(dir, component, `${component}.component.yml`)
|
|
5606
5622
|
);
|
|
5607
|
-
return possiblePaths.find(
|
|
5623
|
+
return possiblePaths.find(existsSync2);
|
|
5608
5624
|
};
|
|
5609
5625
|
var generateImports = (directory) => readdirSync(directory).filter(
|
|
5610
5626
|
(asset) => [".css", ".js", ".mjs", ".twig"].includes(extname(asset))
|
|
@@ -5711,7 +5727,7 @@ var yamlStoriesIndexer = {
|
|
|
5711
5727
|
import twig from "vite-plugin-twig-drupal";
|
|
5712
5728
|
import { mergeConfig } from "vite";
|
|
5713
5729
|
import { resolve as resolve3 } from "path";
|
|
5714
|
-
import { existsSync as
|
|
5730
|
+
import { existsSync as existsSync3 } from "fs";
|
|
5715
5731
|
import glob from "glob";
|
|
5716
5732
|
var cachedComponentDirectories = null;
|
|
5717
5733
|
var getComponentDirectories = () => {
|
|
@@ -5725,7 +5741,7 @@ var resolveComponentPath2 = (namespace, component) => {
|
|
|
5725
5741
|
const possiblePaths = componentDirectories.map(
|
|
5726
5742
|
(dir) => resolve3(`${dir}/${component}/${component}.component.yml`)
|
|
5727
5743
|
);
|
|
5728
|
-
return possiblePaths.find((path2) =>
|
|
5744
|
+
return possiblePaths.find((path2) => existsSync3(path2));
|
|
5729
5745
|
};
|
|
5730
5746
|
function viteFinal(config, options) {
|
|
5731
5747
|
const { namespace } = options.sdcStorybookOptions;
|