storybook-addon-sdc 0.0.10 → 0.0.12

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/preset.js CHANGED
@@ -1,17 +1,43 @@
1
- import {
2
- mergeConfig,
3
- require_main
4
- } from "./chunk-JJLXTDY4.js";
5
- import "./chunk-NKMHZNAM.js";
6
- import {
7
- __commonJS,
8
- __toESM
9
- } from "./chunk-EAQYK3U2.js";
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __esm = (fn, res) => function __init() {
8
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
9
+ };
10
+ var __commonJS = (cb, mod) => function __require() {
11
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+
30
+ // node_modules/tsup/assets/esm_shims.js
31
+ var init_esm_shims = __esm({
32
+ "node_modules/tsup/assets/esm_shims.js"() {
33
+ }
34
+ });
10
35
 
11
36
  // node_modules/yaml/dist/PlainValue-ec8e588e.js
12
37
  var require_PlainValue_ec8e588e = __commonJS({
13
38
  "node_modules/yaml/dist/PlainValue-ec8e588e.js"(exports) {
14
39
  "use strict";
40
+ init_esm_shims();
15
41
  var Char = {
16
42
  ANCHOR: "&",
17
43
  COMMENT: "#",
@@ -707,6 +733,7 @@ ${ctx}
707
733
  var require_parse_cst = __commonJS({
708
734
  "node_modules/yaml/dist/parse-cst.js"(exports) {
709
735
  "use strict";
736
+ init_esm_shims();
710
737
  var PlainValue = require_PlainValue_ec8e588e();
711
738
  var BlankLine = class extends PlainValue.Node {
712
739
  constructor() {
@@ -2139,6 +2166,7 @@ var require_parse_cst = __commonJS({
2139
2166
  var require_resolveSeq_d03cb037 = __commonJS({
2140
2167
  "node_modules/yaml/dist/resolveSeq-d03cb037.js"(exports) {
2141
2168
  "use strict";
2169
+ init_esm_shims();
2142
2170
  var PlainValue = require_PlainValue_ec8e588e();
2143
2171
  function addCommentBefore(str, indent, comment) {
2144
2172
  if (!comment) return str;
@@ -3934,6 +3962,7 @@ ${ca}` : ca;
3934
3962
  var require_warnings_1000a372 = __commonJS({
3935
3963
  "node_modules/yaml/dist/warnings-1000a372.js"(exports) {
3936
3964
  "use strict";
3965
+ init_esm_shims();
3937
3966
  var PlainValue = require_PlainValue_ec8e588e();
3938
3967
  var resolveSeq = require_resolveSeq_d03cb037();
3939
3968
  var binary = {
@@ -4278,6 +4307,7 @@ ${pair.comment}` : item.comment;
4278
4307
  var require_Schema_88e323a7 = __commonJS({
4279
4308
  "node_modules/yaml/dist/Schema-88e323a7.js"(exports) {
4280
4309
  "use strict";
4310
+ init_esm_shims();
4281
4311
  var PlainValue = require_PlainValue_ec8e588e();
4282
4312
  var resolveSeq = require_resolveSeq_d03cb037();
4283
4313
  var warnings = require_warnings_1000a372();
@@ -4731,6 +4761,7 @@ var require_Schema_88e323a7 = __commonJS({
4731
4761
  var require_Document_9b4560a1 = __commonJS({
4732
4762
  "node_modules/yaml/dist/Document-9b4560a1.js"(exports) {
4733
4763
  "use strict";
4764
+ init_esm_shims();
4734
4765
  var PlainValue = require_PlainValue_ec8e588e();
4735
4766
  var resolveSeq = require_resolveSeq_d03cb037();
4736
4767
  var Schema = require_Schema_88e323a7();
@@ -5074,18 +5105,18 @@ ${cbNode.commentBefore}` : cb;
5074
5105
  };
5075
5106
  }
5076
5107
  function resolveYamlDirective(doc, directive) {
5077
- let [version2] = directive.parameters;
5078
- if (directive.name === "YAML:1.0") version2 = "1.0";
5079
- if (!version2) {
5108
+ let [version] = directive.parameters;
5109
+ if (directive.name === "YAML:1.0") version = "1.0";
5110
+ if (!version) {
5080
5111
  const msg = "Insufficient parameters given for %YAML directive";
5081
5112
  throw new PlainValue.YAMLSemanticError(directive, msg);
5082
5113
  }
5083
- if (!documentOptions[version2]) {
5114
+ if (!documentOptions[version]) {
5084
5115
  const v0 = doc.version || doc.options.version;
5085
- const msg = `Document will be parsed as YAML ${v0} rather than YAML ${version2}`;
5116
+ const msg = `Document will be parsed as YAML ${v0} rather than YAML ${version}`;
5086
5117
  doc.warnings.push(new PlainValue.YAMLWarning(directive, msg));
5087
5118
  }
5088
- return version2;
5119
+ return version;
5089
5120
  }
5090
5121
  function parseDirectives(doc, directives, prevDoc) {
5091
5122
  const directiveComments = [];
@@ -5366,6 +5397,7 @@ ${cbNode.commentBefore}` : cb;
5366
5397
  var require_dist = __commonJS({
5367
5398
  "node_modules/yaml/dist/index.js"(exports) {
5368
5399
  "use strict";
5400
+ init_esm_shims();
5369
5401
  var parseCst = require_parse_cst();
5370
5402
  var Document$1 = require_Document_9b4560a1();
5371
5403
  var Schema = require_Schema_88e323a7();
@@ -5435,16 +5467,22 @@ var require_dist = __commonJS({
5435
5467
  // node_modules/yaml/index.js
5436
5468
  var require_yaml = __commonJS({
5437
5469
  "node_modules/yaml/index.js"(exports, module) {
5470
+ init_esm_shims();
5438
5471
  module.exports = require_dist().YAML;
5439
5472
  }
5440
5473
  });
5441
5474
 
5475
+ // src/preset.ts
5476
+ init_esm_shims();
5477
+
5442
5478
  // src/vite-plugin-storybook-yaml-stories.ts
5479
+ init_esm_shims();
5443
5480
  var import_yaml = __toESM(require_yaml(), 1);
5444
5481
  import { readdirSync, readFileSync } from "fs";
5445
5482
  import { dirname, extname, relative, resolve, join } from "path";
5446
5483
 
5447
5484
  // src/argsGenerator.ts
5485
+ init_esm_shims();
5448
5486
  import { JSONSchemaFaker } from "json-schema-faker";
5449
5487
  var generateArgs = (schema) => {
5450
5488
  const generated = JSON.parse(JSON.stringify(JSONSchemaFaker.generate(schema)));
@@ -5471,6 +5509,7 @@ var argsGenerator_default = (content, jsonSchemaFakerOptions) => {
5471
5509
  };
5472
5510
 
5473
5511
  // src/argTypesGenerator.ts
5512
+ init_esm_shims();
5474
5513
  var schemaToArgtypes = (prop) => ({
5475
5514
  ...prop,
5476
5515
  ...prop.enum && {
@@ -5487,6 +5526,7 @@ var argTypesGenerator_default = (content) => {
5487
5526
  };
5488
5527
 
5489
5528
  // src/storiesGenerator.ts
5529
+ init_esm_shims();
5490
5530
  var storiesGenerator_default = (stories) => {
5491
5531
  const generatedStories = [];
5492
5532
  const extractComponentArgsAndSlots = (args) => {
@@ -5536,10 +5576,10 @@ var storiesGenerator_default = (stories) => {
5536
5576
  `export const ${storyKey} = {
5537
5577
  args: {
5538
5578
  ${slotEntries},
5539
- play: async ({ canvasElement }) => {
5540
- Drupal.attachBehaviors(canvasElement, window.drupalSettings);
5541
- },
5542
- }
5579
+ },
5580
+ play: async ({ canvasElement }) => {
5581
+ Drupal.attachBehaviors(canvasElement, window.drupalSettings);
5582
+ },
5543
5583
  };`
5544
5584
  );
5545
5585
  });
@@ -5676,42 +5716,7 @@ var yamlStoriesIndexer = {
5676
5716
 
5677
5717
  // src/preset.ts
5678
5718
  import twig from "vite-plugin-twig-drupal";
5679
-
5680
- // node_modules/vite/dist/node/index.js
5681
- var import_esbuild = __toESM(require_main(), 1);
5682
-
5683
- // node_modules/vite/dist/node/runtime.js
5684
- var SOURCEMAPPING_URL = "sourceMa";
5685
- SOURCEMAPPING_URL += "ppingURL";
5686
- var isWindows = typeof process < "u" && process.platform === "win32";
5687
- var AsyncFunction = async function() {
5688
- }.constructor;
5689
- var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
5690
- var intToChar = new Uint8Array(64);
5691
- var charToInt = new Uint8Array(128);
5692
- for (let i = 0; i < chars.length; i++) {
5693
- const c = chars.charCodeAt(i);
5694
- intToChar[i] = c, charToInt[c] = i;
5695
- }
5696
- var VITE_RUNTIME_SOURCEMAPPING_REGEXP = new RegExp(
5697
- `//# ${SOURCEMAPPING_URL}=data:application/json;base64,(.+)`
5698
- );
5699
- var retrieveFileHandlers = /* @__PURE__ */ new Set();
5700
- var retrieveSourceMapHandlers = /* @__PURE__ */ new Set();
5701
- var createExecHandlers = (handlers) => (...args) => {
5702
- for (const handler of handlers) {
5703
- const result = handler(...args);
5704
- if (result) return result;
5705
- }
5706
- return null;
5707
- };
5708
- var retrieveFileFromHandlers = createExecHandlers(retrieveFileHandlers);
5709
- var retrieveSourceMapFromHandlers = createExecHandlers(
5710
- retrieveSourceMapHandlers
5711
- );
5712
- var originalPrepare = Error.prepareStackTrace;
5713
-
5714
- // src/preset.ts
5719
+ import { mergeConfig } from "vite";
5715
5720
  import { resolve as resolve2, join as join2 } from "path";
5716
5721
  import fs from "fs";
5717
5722
  var getSubdirectories2 = (baseDir) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook-addon-sdc",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "Drupal Single Directory Components as stories",
5
5
  "keywords": [
6
6
  "SDC",