@bpmn-io/form-js-playground 0.9.4 → 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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmn-io/form-js-playground",
3
- "version": "0.9.4",
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.4",
48
- "@bpmn-io/form-js-viewer": "^0.9.4",
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": "d899fc668437a0a515f68d7c3a7d0360dae69374"
69
+ "gitHead": "046005d71d83af0381c2fb4b784fcda483d9fc1f"
70
70
  }