@bpmn-io/form-js-playground 0.9.3 → 0.9.5

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.
@@ -1,36 +1,4 @@
1
- /**
2
- * file-drop.css
3
- */
4
- .drop-overlay {
5
- position: fixed;
6
- top: 0;
7
- left: 0;
8
- bottom: 0;
9
- right: 0;
10
-
11
- padding: 50px;
12
-
13
- background: rgba(255, 255, 255, .9);
14
-
15
- z-index: 1000;
16
- }
17
-
18
- .drop-overlay .box {
19
- text-align: center;
20
- border: dashed 4px #CCC;
21
- height: 100%;
22
- width: 100%;
23
- display: table;
24
- }
25
-
26
- .drop-overlay .label {
27
- font-size: 26px;
28
- color: #888;
29
- margin: auto;
30
-
31
- display: table-cell;
32
- vertical-align: middle;
33
- }.fjs-pgl-root {
1
+ .fjs-pgl-root {
34
2
  --color-button-hover: var(--color-grey-225-10-95);
35
3
 
36
4
  --color-section-border: var(--color-grey-225-10-55);
@@ -253,4 +221,36 @@
253
221
  .fjs-pgl-parent {
254
222
  width: 100%;
255
223
  height: 100%;
224
+ }/**
225
+ * file-drop.css
226
+ */
227
+ .drop-overlay {
228
+ position: fixed;
229
+ top: 0;
230
+ left: 0;
231
+ bottom: 0;
232
+ right: 0;
233
+
234
+ padding: 50px;
235
+
236
+ background: rgba(255, 255, 255, .9);
237
+
238
+ z-index: 1000;
239
+ }
240
+
241
+ .drop-overlay .box {
242
+ text-align: center;
243
+ border: dashed 4px #CCC;
244
+ height: 100%;
245
+ width: 100%;
246
+ display: table;
247
+ }
248
+
249
+ .drop-overlay .label {
250
+ font-size: 26px;
251
+ color: #888;
252
+ margin: auto;
253
+
254
+ display: table-cell;
255
+ vertical-align: middle;
256
256
  }
@@ -2425,7 +2425,7 @@
2425
2425
  }, i;
2426
2426
  })(_$1);
2427
2427
 
2428
- var CLASS_PATTERN = /^class /;
2428
+ const CLASS_PATTERN = /^class[ {]/;
2429
2429
  /**
2430
2430
  * @param {function} fn
2431
2431
  *
@@ -2443,7 +2443,7 @@
2443
2443
 
2444
2444
 
2445
2445
  function isArray(obj) {
2446
- return Object.prototype.toString.call(obj) === '[object Array]';
2446
+ return Array.isArray(obj);
2447
2447
  }
2448
2448
  /**
2449
2449
  * @param {any} obj
@@ -2469,14 +2469,13 @@
2469
2469
  */
2470
2470
 
2471
2471
 
2472
- function annotate() {
2473
- var args = Array.prototype.slice.call(arguments);
2474
-
2472
+ function annotate(...args) {
2475
2473
  if (args.length === 1 && isArray(args[0])) {
2476
2474
  args = args[0];
2477
2475
  }
2478
2476
 
2479
- var fn = args.pop();
2477
+ args = [...args];
2478
+ const fn = args.pop();
2480
2479
  fn.$inject = args;
2481
2480
  return fn;
2482
2481
  } // Current limitations:
@@ -2493,9 +2492,9 @@
2493
2492
  // of a nested class, too.
2494
2493
 
2495
2494
 
2496
- var CONSTRUCTOR_ARGS = /constructor\s*[^(]*\(\s*([^)]*)\)/m;
2497
- var FN_ARGS = /^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m;
2498
- var FN_ARG = /\/\*([^*]*)\*\//m;
2495
+ const CONSTRUCTOR_ARGS = /constructor\s*[^(]*\(\s*([^)]*)\)/m;
2496
+ const FN_ARGS = /^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m;
2497
+ const FN_ARG = /\/\*([^*]*)\*\//m;
2499
2498
  /**
2500
2499
  * @param {unknown} fn
2501
2500
  *
@@ -2504,18 +2503,18 @@
2504
2503
 
2505
2504
  function parseAnnotations(fn) {
2506
2505
  if (typeof fn !== 'function') {
2507
- throw new Error('Cannot annotate "' + fn + '". Expected a function!');
2506
+ throw new Error(`Cannot annotate "${fn}". Expected a function!`);
2508
2507
  }
2509
2508
 
2510
- var match = fn.toString().match(isClass(fn) ? CONSTRUCTOR_ARGS : FN_ARGS); // may parse class without constructor
2509
+ const match = fn.toString().match(isClass(fn) ? CONSTRUCTOR_ARGS : FN_ARGS); // may parse class without constructor
2511
2510
 
2512
2511
  if (!match) {
2513
2512
  return [];
2514
2513
  }
2515
2514
 
2516
- var args = match[1] || match[2];
2517
- return args && args.split(',').map(function (arg) {
2518
- var argMatch = arg.match(FN_ARG);
2515
+ const args = match[1] || match[2];
2516
+ return args && args.split(',').map(arg => {
2517
+ const argMatch = arg.match(FN_ARG);
2519
2518
  return (argMatch && argMatch[1] || arg).trim();
2520
2519
  }) || [];
2521
2520
  }
@@ -2541,19 +2540,19 @@
2541
2540
  if (strict === false) {
2542
2541
  return null;
2543
2542
  } else {
2544
- throw error('No provider for "' + name + '"!');
2543
+ throw error(`No provider for "${name}"!`);
2545
2544
  }
2546
2545
  }
2547
2546
  };
2548
- var currentlyResolving = [];
2549
- var providers = this._providers = Object.create(parent._providers || null);
2550
- var instances = this._instances = Object.create(null);
2551
- var self = instances.injector = this;
2547
+ const currentlyResolving = [];
2548
+ const providers = this._providers = Object.create(parent._providers || null);
2549
+ const instances = this._instances = Object.create(null);
2550
+ const self = instances.injector = this;
2552
2551
 
2553
- var error = function (msg) {
2554
- var stack = currentlyResolving.join(' -> ');
2552
+ const error = function (msg) {
2553
+ const stack = currentlyResolving.join(' -> ');
2555
2554
  currentlyResolving.length = 0;
2556
- return new Error(stack ? msg + ' (Resolving: ' + stack + ')' : msg);
2555
+ return new Error(stack ? `${msg} (Resolving: ${stack})` : msg);
2557
2556
  };
2558
2557
  /**
2559
2558
  * Return a named service.
@@ -2567,8 +2566,8 @@
2567
2566
 
2568
2567
  function get(name, strict) {
2569
2568
  if (!providers[name] && name.indexOf('.') !== -1) {
2570
- var parts = name.split('.');
2571
- var pivot = get(parts.shift());
2569
+ const parts = name.split('.');
2570
+ let pivot = get(parts.shift());
2572
2571
 
2573
2572
  while (parts.length) {
2574
2573
  pivot = pivot[parts.shift()];
@@ -2605,12 +2604,12 @@
2605
2604
  if (isArray(fn)) {
2606
2605
  fn = annotate(fn.slice());
2607
2606
  } else {
2608
- throw new Error('Cannot invoke "' + fn + '". Expected a function!');
2607
+ throw error(`Cannot invoke "${fn}". Expected a function!`);
2609
2608
  }
2610
2609
  }
2611
2610
 
2612
- var inject = fn.$inject || parseAnnotations(fn);
2613
- var dependencies = inject.map(function (dep) {
2611
+ const inject = fn.$inject || parseAnnotations(fn);
2612
+ const dependencies = inject.map(dep => {
2614
2613
  if (hasOwnProp(locals, dep)) {
2615
2614
  return locals[dep];
2616
2615
  } else {
@@ -2624,18 +2623,20 @@
2624
2623
  }
2625
2624
 
2626
2625
  function instantiate(Type) {
2627
- var def = fnDef(Type);
2628
- var fn = def.fn,
2629
- dependencies = def.dependencies; // instantiate var args constructor
2626
+ const {
2627
+ fn,
2628
+ dependencies
2629
+ } = fnDef(Type); // instantiate var args constructor
2630
2630
 
2631
- var Constructor = Function.prototype.bind.apply(fn, [null].concat(dependencies));
2631
+ const Constructor = Function.prototype.bind.apply(fn, [null].concat(dependencies));
2632
2632
  return new Constructor();
2633
2633
  }
2634
2634
 
2635
2635
  function invoke(func, context, locals) {
2636
- var def = fnDef(func, locals);
2637
- var fn = def.fn,
2638
- dependencies = def.dependencies;
2636
+ const {
2637
+ fn,
2638
+ dependencies
2639
+ } = fnDef(func, locals);
2639
2640
  return fn.apply(context, dependencies);
2640
2641
  }
2641
2642
  /**
@@ -2646,9 +2647,7 @@
2646
2647
 
2647
2648
 
2648
2649
  function createPrivateInjectorFactory(childInjector) {
2649
- return annotate(function (key) {
2650
- return childInjector.get(key);
2651
- });
2650
+ return annotate(key => childInjector.get(key));
2652
2651
  }
2653
2652
  /**
2654
2653
  * @param {ModuleDefinition[]} modules
@@ -2660,17 +2659,17 @@
2660
2659
 
2661
2660
  function createChild(modules, forceNewInstances) {
2662
2661
  if (forceNewInstances && forceNewInstances.length) {
2663
- var fromParentModule = Object.create(null);
2664
- var matchedScopes = Object.create(null);
2665
- var privateInjectorsCache = [];
2666
- var privateChildInjectors = [];
2667
- var privateChildFactories = [];
2668
- var provider;
2669
- var cacheIdx;
2670
- var privateChildInjector;
2671
- var privateChildInjectorFactory;
2672
-
2673
- for (var name in providers) {
2662
+ const fromParentModule = Object.create(null);
2663
+ const matchedScopes = Object.create(null);
2664
+ const privateInjectorsCache = [];
2665
+ const privateChildInjectors = [];
2666
+ const privateChildFactories = [];
2667
+ let provider;
2668
+ let cacheIdx;
2669
+ let privateChildInjector;
2670
+ let privateChildInjectorFactory;
2671
+
2672
+ for (let name in providers) {
2674
2673
  provider = providers[name];
2675
2674
 
2676
2675
  if (forceNewInstances.indexOf(name) !== -1) {
@@ -2696,7 +2695,7 @@
2696
2695
 
2697
2696
  if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {
2698
2697
  /* jshint -W083 */
2699
- forceNewInstances.forEach(function (scope) {
2698
+ forceNewInstances.forEach(scope => {
2700
2699
  if (provider[1].$scope.indexOf(scope) !== -1) {
2701
2700
  fromParentModule[name] = [provider[2], provider[1]];
2702
2701
  matchedScopes[scope] = true;
@@ -2705,7 +2704,7 @@
2705
2704
  }
2706
2705
  }
2707
2706
 
2708
- forceNewInstances.forEach(function (scope) {
2707
+ forceNewInstances.forEach(scope => {
2709
2708
  if (!matchedScopes[scope]) {
2710
2709
  throw new Error('No provider for "' + scope + '". Cannot use provider from the parent!');
2711
2710
  }
@@ -2716,7 +2715,7 @@
2716
2715
  return new Injector(modules, self);
2717
2716
  }
2718
2717
 
2719
- var factoryMap = {
2718
+ const factoryMap = {
2720
2719
  factory: invoke,
2721
2720
  type: instantiate,
2722
2721
  value: function (value) {
@@ -2729,9 +2728,9 @@
2729
2728
  */
2730
2729
 
2731
2730
  function createInitializer(moduleDefinition, injector) {
2732
- var initializers = moduleDefinition.__init__ || [];
2731
+ const initializers = moduleDefinition.__init__ || [];
2733
2732
  return function () {
2734
- initializers.forEach(function (initializer) {
2733
+ initializers.forEach(initializer => {
2735
2734
  // eagerly resolve component (fn or string)
2736
2735
  if (typeof initializer === 'string') {
2737
2736
  injector.get(initializer);
@@ -2747,27 +2746,27 @@
2747
2746
 
2748
2747
 
2749
2748
  function loadModule(moduleDefinition) {
2750
- var moduleExports = moduleDefinition.__exports__; // private module
2749
+ const moduleExports = moduleDefinition.__exports__; // private module
2751
2750
 
2752
2751
  if (moduleExports) {
2753
- var nestedModules = moduleDefinition.__modules__;
2754
- var clonedModule = Object.keys(moduleDefinition).reduce(function (clonedModule, key) {
2752
+ const nestedModules = moduleDefinition.__modules__;
2753
+ const clonedModule = Object.keys(moduleDefinition).reduce((clonedModule, key) => {
2755
2754
  if (key !== '__exports__' && key !== '__modules__' && key !== '__init__' && key !== '__depends__') {
2756
2755
  clonedModule[key] = moduleDefinition[key];
2757
2756
  }
2758
2757
 
2759
2758
  return clonedModule;
2760
2759
  }, Object.create(null));
2761
- var childModules = (nestedModules || []).concat(clonedModule);
2762
- var privateInjector = createChild(childModules);
2763
- var getFromPrivateInjector = annotate(function (key) {
2760
+ const childModules = (nestedModules || []).concat(clonedModule);
2761
+ const privateInjector = createChild(childModules);
2762
+ const getFromPrivateInjector = annotate(function (key) {
2764
2763
  return privateInjector.get(key);
2765
2764
  });
2766
2765
  moduleExports.forEach(function (key) {
2767
2766
  providers[key] = [getFromPrivateInjector, key, 'private', privateInjector];
2768
2767
  }); // ensure child injector initializes
2769
2768
 
2770
- var initializers = (moduleDefinition.__init__ || []).slice();
2769
+ const initializers = (moduleDefinition.__init__ || []).slice();
2771
2770
  initializers.unshift(function () {
2772
2771
  privateInjector.init();
2773
2772
  });
@@ -2788,8 +2787,8 @@
2788
2787
  return;
2789
2788
  }
2790
2789
 
2791
- var type = moduleDefinition[key][0];
2792
- var value = moduleDefinition[key][1];
2790
+ const type = moduleDefinition[key][0];
2791
+ const value = moduleDefinition[key][1];
2793
2792
  providers[key] = [factoryMap[type], arrayUnwrap(type, value), type];
2794
2793
  });
2795
2794
  return createInitializer(moduleDefinition, self);
@@ -2823,17 +2822,15 @@
2823
2822
 
2824
2823
 
2825
2824
  function bootstrap(moduleDefinitions) {
2826
- var initializers = moduleDefinitions.reduce(resolveDependencies, []).map(loadModule);
2827
- var initialized = false;
2825
+ const initializers = moduleDefinitions.reduce(resolveDependencies, []).map(loadModule);
2826
+ let initialized = false;
2828
2827
  return function () {
2829
2828
  if (initialized) {
2830
2829
  return;
2831
2830
  }
2832
2831
 
2833
2832
  initialized = true;
2834
- initializers.forEach(function (initializer) {
2835
- return initializer();
2836
- });
2833
+ initializers.forEach(initializer => initializer());
2837
2834
  };
2838
2835
  } // public API
2839
2836
 
@@ -34368,7 +34365,7 @@ meta: meta$1,/// [Metadata](#highlight.tags.meta) that applies to the entire
34368
34365
  this.re = new RegExp(query, baseFlags + ((options === null || options === void 0 ? void 0 : options.ignoreCase) ? "i" : ""));
34369
34366
  this.test = options === null || options === void 0 ? void 0 : options.test;
34370
34367
  this.flat = FlattenedDoc.get(text, from, this.chunkEnd(from + 5000
34371
- /* Base */
34368
+ /* Chunk.Base */
34372
34369
  ));
34373
34370
  }
34374
34371
 
@@ -34825,7 +34822,7 @@ meta: meta$1,/// [Metadata](#highlight.tags.meta) that applies to the entire
34825
34822
  buf = doc.sliceString(bufPos, Math.min(doc.length, to + 2));
34826
34823
  }
34827
34824
 
34828
- return categorizer(charAfter(buf, from - bufPos)) != CharCategory.Word || categorizer(charBefore(buf, to - bufPos)) != CharCategory.Word || categorizer(charBefore(buf, from - bufPos)) != CharCategory.Word && categorizer(charAfter(buf, to - bufPos)) != CharCategory.Word;
34825
+ return (categorizer(charBefore(buf, from - bufPos)) != CharCategory.Word || categorizer(charAfter(buf, from - bufPos)) != CharCategory.Word) && (categorizer(charAfter(buf, to - bufPos)) != CharCategory.Word || categorizer(charBefore(buf, to - bufPos)) != CharCategory.Word);
34829
34826
  };
34830
34827
  }
34831
34828
 
@@ -34845,7 +34842,7 @@ meta: meta$1,/// [Metadata](#highlight.tags.meta) that applies to the entire
34845
34842
  prevMatchInRange(state, from, to) {
34846
34843
  for (let pos = to;;) {
34847
34844
  let start = Math.max(from, pos - 10000
34848
- /* ChunkSize */
34845
+ /* FindPrev.ChunkSize */
34849
34846
  - this.spec.unquoted.length);
34850
34847
  let cursor = stringCursor(this.spec, state, start, pos),
34851
34848
  range = null;
@@ -34855,7 +34852,7 @@ meta: meta$1,/// [Metadata](#highlight.tags.meta) that applies to the entire
34855
34852
  if (range) return range;
34856
34853
  if (start == from) return null;
34857
34854
  pos -= 10000
34858
- /* ChunkSize */
34855
+ /* FindPrev.ChunkSize */
34859
34856
  ;
34860
34857
  }
34861
34858
  }
@@ -34904,7 +34901,7 @@ meta: meta$1,/// [Metadata](#highlight.tags.meta) that applies to the entire
34904
34901
  }
34905
34902
 
34906
34903
  function regexpWordTest(categorizer) {
34907
- return (_from, _to, match) => !match[0].length || categorizer(charAfter(match.input, match.index)) != CharCategory.Word || categorizer(charBefore(match.input, match.index + match[0].length)) != CharCategory.Word || categorizer(charBefore(match.input, match.index)) != CharCategory.Word && categorizer(charAfter(match.input, match.index + match[0].length)) != CharCategory.Word;
34904
+ return (_from, _to, match) => !match[0].length || (categorizer(charBefore(match.input, match.index)) != CharCategory.Word || categorizer(charAfter(match.input, match.index)) != CharCategory.Word) && (categorizer(charAfter(match.input, match.index + match[0].length)) != CharCategory.Word || categorizer(charBefore(match.input, match.index + match[0].length)) != CharCategory.Word);
34908
34905
  }
34909
34906
 
34910
34907
  class RegExpQuery extends QueryType {
@@ -34917,7 +34914,7 @@ meta: meta$1,/// [Metadata](#highlight.tags.meta) that applies to the entire
34917
34914
  prevMatchInRange(state, from, to) {
34918
34915
  for (let size = 1;; size++) {
34919
34916
  let start = Math.max(from, to - size * 10000
34920
- /* ChunkSize */
34917
+ /* FindPrev.ChunkSize */
34921
34918
  );
34922
34919
  let cursor = regexpCursor(this.spec, state, start, to),
34923
34920
  range = null;
@@ -34951,9 +34948,9 @@ meta: meta$1,/// [Metadata](#highlight.tags.meta) that applies to the entire
34951
34948
 
34952
34949
  highlight(state, from, to, add) {
34953
34950
  let cursor = regexpCursor(this.spec, state, Math.max(0, from - 250
34954
- /* HighlightMargin */
34951
+ /* RegExp.HighlightMargin */
34955
34952
  ), Math.min(to + 250
34956
- /* HighlightMargin */
34953
+ /* RegExp.HighlightMargin */
34957
34954
  , state.doc.length));
34958
34955
 
34959
34956
  while (!cursor.next().done) add(cursor.value.from, cursor.value.to);
@@ -35029,7 +35026,7 @@ meta: meta$1,/// [Metadata](#highlight.tags.meta) that applies to the entire
35029
35026
  } = ranges[i];
35030
35027
 
35031
35028
  while (i < l - 1 && to > ranges[i + 1].from - 2 * 250
35032
- /* HighlightMargin */
35029
+ /* RegExp.HighlightMargin */
35033
35030
  ) to = ranges[++i].to;
35034
35031
 
35035
35032
  query.highlight(view.state, from, to, (from, to) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmn-io/form-js-playground",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "description": "A form-js playground",
5
5
  "files": [
6
6
  "dist"
@@ -44,8 +44,8 @@
44
44
  "url": "https://github.com/bpmn-io"
45
45
  },
46
46
  "dependencies": {
47
- "@bpmn-io/form-js-editor": "^0.9.3",
48
- "@bpmn-io/form-js-viewer": "^0.9.1",
47
+ "@bpmn-io/form-js-editor": "^0.9.5",
48
+ "@bpmn-io/form-js-viewer": "^0.9.5",
49
49
  "@codemirror/lang-json": "^6.0.0",
50
50
  "@codemirror/state": "^6.1.1",
51
51
  "@codemirror/view": "^6.2.0",
@@ -66,5 +66,5 @@
66
66
  "rollup-plugin-css-only": "^3.1.0",
67
67
  "style-loader": "^3.3.0"
68
68
  },
69
- "gitHead": "30da0941eeabb3219cf5fa43728ceff6b2328449"
69
+ "gitHead": "046005d71d83af0381c2fb4b784fcda483d9fc1f"
70
70
  }