inline-style-editor 1.0.2 → 1.1.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.
@@ -44,6 +44,9 @@ function text(data) {
44
44
  function space() {
45
45
  return text(' ');
46
46
  }
47
+ function empty() {
48
+ return text('');
49
+ }
47
50
  function listen(node, event, handler, options) {
48
51
  node.addEventListener(event, handler, options);
49
52
  return () => node.removeEventListener(event, handler, options);
@@ -102,6 +105,10 @@ function schedule_update() {
102
105
  resolved_promise.then(flush);
103
106
  }
104
107
  }
108
+ function tick() {
109
+ schedule_update();
110
+ return resolved_promise;
111
+ }
105
112
  function add_render_callback(fn) {
106
113
  render_callbacks.push(fn);
107
114
  }
@@ -340,890 +347,28 @@ class SvelteComponent {
340
347
  }
341
348
  }
342
349
 
343
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
344
-
345
- /**
346
- * lodash (Custom Build) <https://lodash.com/>
347
- * Build: `lodash modularize exports="npm" -o ./`
348
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
349
- * Released under MIT license <https://lodash.com/license>
350
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
351
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
352
- */
353
-
354
- /** Used as references for various `Number` constants. */
355
- var INFINITY = 1 / 0,
356
- MAX_SAFE_INTEGER = 9007199254740991;
357
-
358
- /** `Object#toString` result references. */
359
- var argsTag = '[object Arguments]',
360
- funcTag = '[object Function]',
361
- genTag = '[object GeneratorFunction]',
362
- symbolTag$1 = '[object Symbol]';
363
-
364
- /** Detect free variable `global` from Node.js. */
365
- var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
366
-
367
- /** Detect free variable `self`. */
368
- var freeSelf$1 = typeof self == 'object' && self && self.Object === Object && self;
369
-
370
- /** Used as a reference to the global object. */
371
- var root$1 = freeGlobal$1 || freeSelf$1 || Function('return this')();
372
-
373
- /**
374
- * A faster alternative to `Function#apply`, this function invokes `func`
375
- * with the `this` binding of `thisArg` and the arguments of `args`.
376
- *
377
- * @private
378
- * @param {Function} func The function to invoke.
379
- * @param {*} thisArg The `this` binding of `func`.
380
- * @param {Array} args The arguments to invoke `func` with.
381
- * @returns {*} Returns the result of `func`.
382
- */
383
- function apply(func, thisArg, args) {
384
- switch (args.length) {
385
- case 0: return func.call(thisArg);
386
- case 1: return func.call(thisArg, args[0]);
387
- case 2: return func.call(thisArg, args[0], args[1]);
388
- case 3: return func.call(thisArg, args[0], args[1], args[2]);
389
- }
390
- return func.apply(thisArg, args);
391
- }
392
-
393
- /**
394
- * A specialized version of `_.map` for arrays without support for iteratee
395
- * shorthands.
396
- *
397
- * @private
398
- * @param {Array} [array] The array to iterate over.
399
- * @param {Function} iteratee The function invoked per iteration.
400
- * @returns {Array} Returns the new mapped array.
401
- */
402
- function arrayMap(array, iteratee) {
403
- var index = -1,
404
- length = array ? array.length : 0,
405
- result = Array(length);
406
-
407
- while (++index < length) {
408
- result[index] = iteratee(array[index], index, array);
409
- }
410
- return result;
411
- }
412
-
413
- /**
414
- * Appends the elements of `values` to `array`.
415
- *
416
- * @private
417
- * @param {Array} array The array to modify.
418
- * @param {Array} values The values to append.
419
- * @returns {Array} Returns `array`.
420
- */
421
- function arrayPush(array, values) {
422
- var index = -1,
423
- length = values.length,
424
- offset = array.length;
425
-
426
- while (++index < length) {
427
- array[offset + index] = values[index];
428
- }
429
- return array;
430
- }
431
-
432
- /** Used for built-in method references. */
433
- var objectProto$1 = Object.prototype;
434
-
435
- /** Used to check objects for own properties. */
436
- var hasOwnProperty = objectProto$1.hasOwnProperty;
437
-
438
- /**
439
- * Used to resolve the
440
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
441
- * of values.
442
- */
443
- var objectToString$1 = objectProto$1.toString;
444
-
445
- /** Built-in value references. */
446
- var Symbol$1 = root$1.Symbol,
447
- propertyIsEnumerable = objectProto$1.propertyIsEnumerable,
448
- spreadableSymbol = Symbol$1 ? Symbol$1.isConcatSpreadable : undefined;
449
-
450
- /* Built-in method references for those with the same name as other `lodash` methods. */
451
- var nativeMax$1 = Math.max;
452
-
453
- /**
454
- * The base implementation of `_.flatten` with support for restricting flattening.
455
- *
456
- * @private
457
- * @param {Array} array The array to flatten.
458
- * @param {number} depth The maximum recursion depth.
459
- * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
460
- * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
461
- * @param {Array} [result=[]] The initial result value.
462
- * @returns {Array} Returns the new flattened array.
463
- */
464
- function baseFlatten(array, depth, predicate, isStrict, result) {
465
- var index = -1,
466
- length = array.length;
467
-
468
- predicate || (predicate = isFlattenable);
469
- result || (result = []);
470
-
471
- while (++index < length) {
472
- var value = array[index];
473
- if (depth > 0 && predicate(value)) {
474
- if (depth > 1) {
475
- // Recursively flatten arrays (susceptible to call stack limits).
476
- baseFlatten(value, depth - 1, predicate, isStrict, result);
477
- } else {
478
- arrayPush(result, value);
479
- }
480
- } else if (!isStrict) {
481
- result[result.length] = value;
482
- }
483
- }
484
- return result;
485
- }
486
-
487
- /**
488
- * The base implementation of `_.pick` without support for individual
489
- * property identifiers.
490
- *
491
- * @private
492
- * @param {Object} object The source object.
493
- * @param {string[]} props The property identifiers to pick.
494
- * @returns {Object} Returns the new object.
495
- */
496
- function basePick(object, props) {
497
- object = Object(object);
498
- return basePickBy(object, props, function(value, key) {
499
- return key in object;
500
- });
501
- }
502
-
503
- /**
504
- * The base implementation of `_.pickBy` without support for iteratee shorthands.
505
- *
506
- * @private
507
- * @param {Object} object The source object.
508
- * @param {string[]} props The property identifiers to pick from.
509
- * @param {Function} predicate The function invoked per property.
510
- * @returns {Object} Returns the new object.
511
- */
512
- function basePickBy(object, props, predicate) {
513
- var index = -1,
514
- length = props.length,
515
- result = {};
516
-
517
- while (++index < length) {
518
- var key = props[index],
519
- value = object[key];
520
-
521
- if (predicate(value, key)) {
522
- result[key] = value;
523
- }
524
- }
525
- return result;
526
- }
527
-
528
- /**
529
- * The base implementation of `_.rest` which doesn't validate or coerce arguments.
530
- *
531
- * @private
532
- * @param {Function} func The function to apply a rest parameter to.
533
- * @param {number} [start=func.length-1] The start position of the rest parameter.
534
- * @returns {Function} Returns the new function.
535
- */
536
- function baseRest(func, start) {
537
- start = nativeMax$1(start === undefined ? (func.length - 1) : start, 0);
538
- return function() {
539
- var args = arguments,
540
- index = -1,
541
- length = nativeMax$1(args.length - start, 0),
542
- array = Array(length);
543
-
544
- while (++index < length) {
545
- array[index] = args[start + index];
546
- }
547
- index = -1;
548
- var otherArgs = Array(start + 1);
549
- while (++index < start) {
550
- otherArgs[index] = args[index];
551
- }
552
- otherArgs[start] = array;
553
- return apply(func, this, otherArgs);
554
- };
555
- }
556
-
557
- /**
558
- * Checks if `value` is a flattenable `arguments` object or array.
559
- *
560
- * @private
561
- * @param {*} value The value to check.
562
- * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
563
- */
564
- function isFlattenable(value) {
565
- return isArray(value) || isArguments(value) ||
566
- !!(spreadableSymbol && value && value[spreadableSymbol]);
567
- }
568
-
569
- /**
570
- * Converts `value` to a string key if it's not a string or symbol.
571
- *
572
- * @private
573
- * @param {*} value The value to inspect.
574
- * @returns {string|symbol} Returns the key.
575
- */
576
- function toKey(value) {
577
- if (typeof value == 'string' || isSymbol$1(value)) {
578
- return value;
579
- }
580
- var result = (value + '');
581
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
582
- }
583
-
584
- /**
585
- * Checks if `value` is likely an `arguments` object.
586
- *
587
- * @static
588
- * @memberOf _
589
- * @since 0.1.0
590
- * @category Lang
591
- * @param {*} value The value to check.
592
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
593
- * else `false`.
594
- * @example
595
- *
596
- * _.isArguments(function() { return arguments; }());
597
- * // => true
598
- *
599
- * _.isArguments([1, 2, 3]);
600
- * // => false
601
- */
602
- function isArguments(value) {
603
- // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
604
- return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
605
- (!propertyIsEnumerable.call(value, 'callee') || objectToString$1.call(value) == argsTag);
606
- }
607
-
608
- /**
609
- * Checks if `value` is classified as an `Array` object.
610
- *
611
- * @static
612
- * @memberOf _
613
- * @since 0.1.0
614
- * @category Lang
615
- * @param {*} value The value to check.
616
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
617
- * @example
618
- *
619
- * _.isArray([1, 2, 3]);
620
- * // => true
621
- *
622
- * _.isArray(document.body.children);
623
- * // => false
624
- *
625
- * _.isArray('abc');
626
- * // => false
627
- *
628
- * _.isArray(_.noop);
629
- * // => false
630
- */
631
- var isArray = Array.isArray;
632
-
633
- /**
634
- * Checks if `value` is array-like. A value is considered array-like if it's
635
- * not a function and has a `value.length` that's an integer greater than or
636
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
637
- *
638
- * @static
639
- * @memberOf _
640
- * @since 4.0.0
641
- * @category Lang
642
- * @param {*} value The value to check.
643
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
644
- * @example
645
- *
646
- * _.isArrayLike([1, 2, 3]);
647
- * // => true
648
- *
649
- * _.isArrayLike(document.body.children);
650
- * // => true
651
- *
652
- * _.isArrayLike('abc');
653
- * // => true
654
- *
655
- * _.isArrayLike(_.noop);
656
- * // => false
657
- */
658
- function isArrayLike(value) {
659
- return value != null && isLength(value.length) && !isFunction(value);
660
- }
661
-
662
- /**
663
- * This method is like `_.isArrayLike` except that it also checks if `value`
664
- * is an object.
665
- *
666
- * @static
667
- * @memberOf _
668
- * @since 4.0.0
669
- * @category Lang
670
- * @param {*} value The value to check.
671
- * @returns {boolean} Returns `true` if `value` is an array-like object,
672
- * else `false`.
673
- * @example
674
- *
675
- * _.isArrayLikeObject([1, 2, 3]);
676
- * // => true
677
- *
678
- * _.isArrayLikeObject(document.body.children);
679
- * // => true
680
- *
681
- * _.isArrayLikeObject('abc');
682
- * // => false
683
- *
684
- * _.isArrayLikeObject(_.noop);
685
- * // => false
686
- */
687
- function isArrayLikeObject(value) {
688
- return isObjectLike$1(value) && isArrayLike(value);
689
- }
690
-
691
- /**
692
- * Checks if `value` is classified as a `Function` object.
693
- *
694
- * @static
695
- * @memberOf _
696
- * @since 0.1.0
697
- * @category Lang
698
- * @param {*} value The value to check.
699
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
700
- * @example
701
- *
702
- * _.isFunction(_);
703
- * // => true
704
- *
705
- * _.isFunction(/abc/);
706
- * // => false
707
- */
708
- function isFunction(value) {
709
- // The use of `Object#toString` avoids issues with the `typeof` operator
710
- // in Safari 8-9 which returns 'object' for typed array and other constructors.
711
- var tag = isObject$1(value) ? objectToString$1.call(value) : '';
712
- return tag == funcTag || tag == genTag;
713
- }
714
-
715
- /**
716
- * Checks if `value` is a valid array-like length.
717
- *
718
- * **Note:** This method is loosely based on
719
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
720
- *
721
- * @static
722
- * @memberOf _
723
- * @since 4.0.0
724
- * @category Lang
725
- * @param {*} value The value to check.
726
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
727
- * @example
728
- *
729
- * _.isLength(3);
730
- * // => true
731
- *
732
- * _.isLength(Number.MIN_VALUE);
733
- * // => false
734
- *
735
- * _.isLength(Infinity);
736
- * // => false
737
- *
738
- * _.isLength('3');
739
- * // => false
740
- */
741
- function isLength(value) {
742
- return typeof value == 'number' &&
743
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
744
- }
745
-
746
- /**
747
- * Checks if `value` is the
748
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
749
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
750
- *
751
- * @static
752
- * @memberOf _
753
- * @since 0.1.0
754
- * @category Lang
755
- * @param {*} value The value to check.
756
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
757
- * @example
758
- *
759
- * _.isObject({});
760
- * // => true
761
- *
762
- * _.isObject([1, 2, 3]);
763
- * // => true
764
- *
765
- * _.isObject(_.noop);
766
- * // => true
767
- *
768
- * _.isObject(null);
769
- * // => false
770
- */
771
- function isObject$1(value) {
772
- var type = typeof value;
773
- return !!value && (type == 'object' || type == 'function');
774
- }
775
-
776
- /**
777
- * Checks if `value` is object-like. A value is object-like if it's not `null`
778
- * and has a `typeof` result of "object".
779
- *
780
- * @static
781
- * @memberOf _
782
- * @since 4.0.0
783
- * @category Lang
784
- * @param {*} value The value to check.
785
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
786
- * @example
787
- *
788
- * _.isObjectLike({});
789
- * // => true
790
- *
791
- * _.isObjectLike([1, 2, 3]);
792
- * // => true
793
- *
794
- * _.isObjectLike(_.noop);
795
- * // => false
796
- *
797
- * _.isObjectLike(null);
798
- * // => false
799
- */
800
- function isObjectLike$1(value) {
801
- return !!value && typeof value == 'object';
802
- }
803
-
804
- /**
805
- * Checks if `value` is classified as a `Symbol` primitive or object.
806
- *
807
- * @static
808
- * @memberOf _
809
- * @since 4.0.0
810
- * @category Lang
811
- * @param {*} value The value to check.
812
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
813
- * @example
814
- *
815
- * _.isSymbol(Symbol.iterator);
816
- * // => true
817
- *
818
- * _.isSymbol('abc');
819
- * // => false
820
- */
821
- function isSymbol$1(value) {
822
- return typeof value == 'symbol' ||
823
- (isObjectLike$1(value) && objectToString$1.call(value) == symbolTag$1);
824
- }
825
-
826
- /**
827
- * Creates an object composed of the picked `object` properties.
828
- *
829
- * @static
830
- * @since 0.1.0
831
- * @memberOf _
832
- * @category Object
833
- * @param {Object} object The source object.
834
- * @param {...(string|string[])} [props] The property identifiers to pick.
835
- * @returns {Object} Returns the new object.
836
- * @example
837
- *
838
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
839
- *
840
- * _.pick(object, ['a', 'c']);
841
- * // => { 'a': 1, 'c': 3 }
842
- */
843
- var pick = baseRest(function(object, props) {
844
- return object == null ? {} : basePick(object, arrayMap(baseFlatten(props, 1), toKey));
845
- });
846
-
847
- var lodash_pick = pick;
848
-
849
- /**
850
- * lodash (Custom Build) <https://lodash.com/>
851
- * Build: `lodash modularize exports="npm" -o ./`
852
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
853
- * Released under MIT license <https://lodash.com/license>
854
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
855
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
856
- */
857
-
858
- /** Used as the `TypeError` message for "Functions" methods. */
859
- var FUNC_ERROR_TEXT = 'Expected a function';
860
-
861
- /** Used as references for various `Number` constants. */
862
- var NAN = 0 / 0;
863
-
864
- /** `Object#toString` result references. */
865
- var symbolTag = '[object Symbol]';
866
-
867
- /** Used to match leading and trailing whitespace. */
868
- var reTrim = /^\s+|\s+$/g;
869
-
870
- /** Used to detect bad signed hexadecimal string values. */
871
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
872
-
873
- /** Used to detect binary string values. */
874
- var reIsBinary = /^0b[01]+$/i;
875
-
876
- /** Used to detect octal string values. */
877
- var reIsOctal = /^0o[0-7]+$/i;
878
-
879
- /** Built-in method references without a dependency on `root`. */
880
- var freeParseInt = parseInt;
881
-
882
- /** Detect free variable `global` from Node.js. */
883
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
884
-
885
- /** Detect free variable `self`. */
886
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
887
-
888
- /** Used as a reference to the global object. */
889
- var root = freeGlobal || freeSelf || Function('return this')();
890
-
891
- /** Used for built-in method references. */
892
- var objectProto = Object.prototype;
893
-
894
- /**
895
- * Used to resolve the
896
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
897
- * of values.
898
- */
899
- var objectToString = objectProto.toString;
900
-
901
- /* Built-in method references for those with the same name as other `lodash` methods. */
902
- var nativeMax = Math.max,
903
- nativeMin = Math.min;
904
-
905
- /**
906
- * Gets the timestamp of the number of milliseconds that have elapsed since
907
- * the Unix epoch (1 January 1970 00:00:00 UTC).
908
- *
909
- * @static
910
- * @memberOf _
911
- * @since 2.4.0
912
- * @category Date
913
- * @returns {number} Returns the timestamp.
914
- * @example
915
- *
916
- * _.defer(function(stamp) {
917
- * console.log(_.now() - stamp);
918
- * }, _.now());
919
- * // => Logs the number of milliseconds it took for the deferred invocation.
920
- */
921
- var now = function() {
922
- return root.Date.now();
923
- };
924
-
925
- /**
926
- * Creates a debounced function that delays invoking `func` until after `wait`
927
- * milliseconds have elapsed since the last time the debounced function was
928
- * invoked. The debounced function comes with a `cancel` method to cancel
929
- * delayed `func` invocations and a `flush` method to immediately invoke them.
930
- * Provide `options` to indicate whether `func` should be invoked on the
931
- * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
932
- * with the last arguments provided to the debounced function. Subsequent
933
- * calls to the debounced function return the result of the last `func`
934
- * invocation.
935
- *
936
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
937
- * invoked on the trailing edge of the timeout only if the debounced function
938
- * is invoked more than once during the `wait` timeout.
939
- *
940
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
941
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
942
- *
943
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
944
- * for details over the differences between `_.debounce` and `_.throttle`.
945
- *
946
- * @static
947
- * @memberOf _
948
- * @since 0.1.0
949
- * @category Function
950
- * @param {Function} func The function to debounce.
951
- * @param {number} [wait=0] The number of milliseconds to delay.
952
- * @param {Object} [options={}] The options object.
953
- * @param {boolean} [options.leading=false]
954
- * Specify invoking on the leading edge of the timeout.
955
- * @param {number} [options.maxWait]
956
- * The maximum time `func` is allowed to be delayed before it's invoked.
957
- * @param {boolean} [options.trailing=true]
958
- * Specify invoking on the trailing edge of the timeout.
959
- * @returns {Function} Returns the new debounced function.
960
- * @example
961
- *
962
- * // Avoid costly calculations while the window size is in flux.
963
- * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
964
- *
965
- * // Invoke `sendMail` when clicked, debouncing subsequent calls.
966
- * jQuery(element).on('click', _.debounce(sendMail, 300, {
967
- * 'leading': true,
968
- * 'trailing': false
969
- * }));
970
- *
971
- * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
972
- * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
973
- * var source = new EventSource('/stream');
974
- * jQuery(source).on('message', debounced);
975
- *
976
- * // Cancel the trailing debounced invocation.
977
- * jQuery(window).on('popstate', debounced.cancel);
978
- */
979
- function debounce(func, wait, options) {
980
- var lastArgs,
981
- lastThis,
982
- maxWait,
983
- result,
984
- timerId,
985
- lastCallTime,
986
- lastInvokeTime = 0,
987
- leading = false,
988
- maxing = false,
989
- trailing = true;
990
-
991
- if (typeof func != 'function') {
992
- throw new TypeError(FUNC_ERROR_TEXT);
993
- }
994
- wait = toNumber(wait) || 0;
995
- if (isObject(options)) {
996
- leading = !!options.leading;
997
- maxing = 'maxWait' in options;
998
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
999
- trailing = 'trailing' in options ? !!options.trailing : trailing;
1000
- }
1001
-
1002
- function invokeFunc(time) {
1003
- var args = lastArgs,
1004
- thisArg = lastThis;
1005
-
1006
- lastArgs = lastThis = undefined;
1007
- lastInvokeTime = time;
1008
- result = func.apply(thisArg, args);
1009
- return result;
1010
- }
1011
-
1012
- function leadingEdge(time) {
1013
- // Reset any `maxWait` timer.
1014
- lastInvokeTime = time;
1015
- // Start the timer for the trailing edge.
1016
- timerId = setTimeout(timerExpired, wait);
1017
- // Invoke the leading edge.
1018
- return leading ? invokeFunc(time) : result;
1019
- }
1020
-
1021
- function remainingWait(time) {
1022
- var timeSinceLastCall = time - lastCallTime,
1023
- timeSinceLastInvoke = time - lastInvokeTime,
1024
- result = wait - timeSinceLastCall;
1025
-
1026
- return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
1027
- }
1028
-
1029
- function shouldInvoke(time) {
1030
- var timeSinceLastCall = time - lastCallTime,
1031
- timeSinceLastInvoke = time - lastInvokeTime;
1032
-
1033
- // Either this is the first call, activity has stopped and we're at the
1034
- // trailing edge, the system time has gone backwards and we're treating
1035
- // it as the trailing edge, or we've hit the `maxWait` limit.
1036
- return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
1037
- (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
1038
- }
1039
-
1040
- function timerExpired() {
1041
- var time = now();
1042
- if (shouldInvoke(time)) {
1043
- return trailingEdge(time);
1044
- }
1045
- // Restart the timer.
1046
- timerId = setTimeout(timerExpired, remainingWait(time));
1047
- }
1048
-
1049
- function trailingEdge(time) {
1050
- timerId = undefined;
1051
-
1052
- // Only invoke if we have `lastArgs` which means `func` has been
1053
- // debounced at least once.
1054
- if (trailing && lastArgs) {
1055
- return invokeFunc(time);
1056
- }
1057
- lastArgs = lastThis = undefined;
1058
- return result;
1059
- }
1060
-
1061
- function cancel() {
1062
- if (timerId !== undefined) {
1063
- clearTimeout(timerId);
1064
- }
1065
- lastInvokeTime = 0;
1066
- lastArgs = lastCallTime = lastThis = timerId = undefined;
1067
- }
1068
-
1069
- function flush() {
1070
- return timerId === undefined ? result : trailingEdge(now());
1071
- }
1072
-
1073
- function debounced() {
1074
- var time = now(),
1075
- isInvoking = shouldInvoke(time);
1076
-
1077
- lastArgs = arguments;
1078
- lastThis = this;
1079
- lastCallTime = time;
1080
-
1081
- if (isInvoking) {
1082
- if (timerId === undefined) {
1083
- return leadingEdge(lastCallTime);
1084
- }
1085
- if (maxing) {
1086
- // Handle invocations in a tight loop.
1087
- timerId = setTimeout(timerExpired, wait);
1088
- return invokeFunc(lastCallTime);
1089
- }
1090
- }
1091
- if (timerId === undefined) {
1092
- timerId = setTimeout(timerExpired, wait);
1093
- }
1094
- return result;
1095
- }
1096
- debounced.cancel = cancel;
1097
- debounced.flush = flush;
1098
- return debounced;
1099
- }
1100
-
1101
- /**
1102
- * Checks if `value` is the
1103
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1104
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1105
- *
1106
- * @static
1107
- * @memberOf _
1108
- * @since 0.1.0
1109
- * @category Lang
1110
- * @param {*} value The value to check.
1111
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1112
- * @example
1113
- *
1114
- * _.isObject({});
1115
- * // => true
1116
- *
1117
- * _.isObject([1, 2, 3]);
1118
- * // => true
1119
- *
1120
- * _.isObject(_.noop);
1121
- * // => true
1122
- *
1123
- * _.isObject(null);
1124
- * // => false
1125
- */
1126
- function isObject(value) {
1127
- var type = typeof value;
1128
- return !!value && (type == 'object' || type == 'function');
350
+ function pick(obj, keys) {
351
+ return keys.reduce((picked, curKey) => {
352
+ picked[curKey] = obj[curKey];
353
+ return picked;
354
+ }, {});
1129
355
  }
1130
356
 
1131
- /**
1132
- * Checks if `value` is object-like. A value is object-like if it's not `null`
1133
- * and has a `typeof` result of "object".
1134
- *
1135
- * @static
1136
- * @memberOf _
1137
- * @since 4.0.0
1138
- * @category Lang
1139
- * @param {*} value The value to check.
1140
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1141
- * @example
1142
- *
1143
- * _.isObjectLike({});
1144
- * // => true
1145
- *
1146
- * _.isObjectLike([1, 2, 3]);
1147
- * // => true
1148
- *
1149
- * _.isObjectLike(_.noop);
1150
- * // => false
1151
- *
1152
- * _.isObjectLike(null);
1153
- * // => false
1154
- */
1155
- function isObjectLike(value) {
1156
- return !!value && typeof value == 'object';
1157
- }
1158
-
1159
- /**
1160
- * Checks if `value` is classified as a `Symbol` primitive or object.
1161
- *
1162
- * @static
1163
- * @memberOf _
1164
- * @since 4.0.0
1165
- * @category Lang
1166
- * @param {*} value The value to check.
1167
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
1168
- * @example
1169
- *
1170
- * _.isSymbol(Symbol.iterator);
1171
- * // => true
1172
- *
1173
- * _.isSymbol('abc');
1174
- * // => false
1175
- */
1176
- function isSymbol(value) {
1177
- return typeof value == 'symbol' ||
1178
- (isObjectLike(value) && objectToString.call(value) == symbolTag);
1179
- }
1180
-
1181
- /**
1182
- * Converts `value` to a number.
1183
- *
1184
- * @static
1185
- * @memberOf _
1186
- * @since 4.0.0
1187
- * @category Lang
1188
- * @param {*} value The value to process.
1189
- * @returns {number} Returns the number.
1190
- * @example
1191
- *
1192
- * _.toNumber(3.2);
1193
- * // => 3.2
1194
- *
1195
- * _.toNumber(Number.MIN_VALUE);
1196
- * // => 5e-324
1197
- *
1198
- * _.toNumber(Infinity);
1199
- * // => Infinity
1200
- *
1201
- * _.toNumber('3.2');
1202
- * // => 3.2
1203
- */
1204
- function toNumber(value) {
1205
- if (typeof value == 'number') {
1206
- return value;
1207
- }
1208
- if (isSymbol(value)) {
1209
- return NAN;
1210
- }
1211
- if (isObject(value)) {
1212
- var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
1213
- value = isObject(other) ? (other + '') : other;
1214
- }
1215
- if (typeof value != 'string') {
1216
- return value === 0 ? value : +value;
1217
- }
1218
- value = value.replace(reTrim, '');
1219
- var isBinary = reIsBinary.test(value);
1220
- return (isBinary || reIsOctal.test(value))
1221
- ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
1222
- : (reIsBadHex.test(value) ? NAN : +value);
357
+ function debounce(func, wait, immediate = false) {
358
+ let timeout;
359
+ return function() {
360
+ const context = this, args = arguments;
361
+ const later = function() {
362
+ timeout = null;
363
+ if (!immediate) func.apply(context, args);
364
+ };
365
+ const callNow = immediate && !timeout;
366
+ clearTimeout(timeout);
367
+ timeout = setTimeout(later, wait);
368
+ if (callNow) func.apply(context, args);
369
+ };
1223
370
  }
1224
371
 
1225
- var lodash_debounce = debounce;
1226
-
1227
372
  function ascending$1(a, b) {
1228
373
  return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
1229
374
  }
@@ -2862,51 +2007,51 @@ function getFonts() {
2862
2007
 
2863
2008
  function get_each_context(ctx, list, i) {
2864
2009
  const child_ctx = ctx.slice();
2865
- child_ctx[53] = list[i][0];
2866
- child_ctx[54] = list[i][1];
2867
- child_ctx[56] = list;
2868
- child_ctx[57] = i;
2869
- const constants_0 = /*choices*/ child_ctx[54].props[/*choices*/ child_ctx[54].selected];
2870
- child_ctx[55] = constants_0;
2010
+ child_ctx[57] = list[i][0];
2011
+ child_ctx[58] = list[i][1];
2012
+ child_ctx[60] = list;
2013
+ child_ctx[61] = i;
2014
+ const constants_0 = /*choices*/ child_ctx[58].props[/*choices*/ child_ctx[58].selected];
2015
+ child_ctx[59] = constants_0;
2871
2016
  return child_ctx;
2872
2017
  }
2873
2018
 
2874
2019
  function get_each_context_1(ctx, list, i) {
2875
2020
  const child_ctx = ctx.slice();
2876
- child_ctx[58] = list[i];
2021
+ child_ctx[62] = list[i];
2877
2022
  return child_ctx;
2878
2023
  }
2879
2024
 
2880
2025
  function get_each_context_2(ctx, list, i) {
2881
2026
  const child_ctx = ctx.slice();
2882
- child_ctx[61] = list[i];
2883
- child_ctx[63] = i;
2027
+ child_ctx[65] = list[i];
2028
+ child_ctx[67] = i;
2884
2029
  return child_ctx;
2885
2030
  }
2886
2031
 
2887
2032
  function get_each_context_3(ctx, list, i) {
2888
2033
  const child_ctx = ctx.slice();
2889
- child_ctx[64] = list[i];
2890
- child_ctx[66] = i;
2034
+ child_ctx[68] = list[i];
2035
+ child_ctx[70] = i;
2891
2036
  return child_ctx;
2892
2037
  }
2893
2038
 
2894
2039
  function get_each_context_4(ctx, list, i) {
2895
2040
  const child_ctx = ctx.slice();
2896
- child_ctx[67] = list[i];
2897
- child_ctx[69] = i;
2041
+ child_ctx[71] = list[i];
2042
+ child_ctx[73] = i;
2898
2043
  return child_ctx;
2899
2044
  }
2900
2045
 
2901
2046
  function get_each_context_5(ctx, list, i) {
2902
2047
  const child_ctx = ctx.slice();
2903
- child_ctx[70] = list[i];
2904
- child_ctx[72] = i;
2048
+ child_ctx[74] = list[i];
2049
+ child_ctx[76] = i;
2905
2050
  return child_ctx;
2906
2051
  }
2907
2052
 
2908
- // (313:4) {#if targetsToSearch.length > 1}
2909
- function create_if_block_6(ctx) {
2053
+ // (365:4) {#if targetsToSearch.length > 1}
2054
+ function create_if_block_7(ctx) {
2910
2055
  let div;
2911
2056
  let b;
2912
2057
  let t1;
@@ -2970,7 +2115,7 @@ function create_if_block_6(ctx) {
2970
2115
  };
2971
2116
  }
2972
2117
 
2973
- // (316:8) {#each targetsToSearch as target, elemIndex}
2118
+ // (368:8) {#each targetsToSearch as target, elemIndex}
2974
2119
  function create_each_block_5(ctx) {
2975
2120
  let span;
2976
2121
  let t0;
@@ -2980,16 +2125,16 @@ function create_each_block_5(ctx) {
2980
2125
  let dispose;
2981
2126
 
2982
2127
  function click_handler() {
2983
- return /*click_handler*/ ctx[27](/*elemIndex*/ ctx[72]);
2128
+ return /*click_handler*/ ctx[31](/*elemIndex*/ ctx[76]);
2984
2129
  }
2985
2130
 
2986
2131
  return {
2987
2132
  c() {
2988
2133
  span = element("span");
2989
2134
  t0 = text("Elem ");
2990
- t1 = text(/*elemIndex*/ ctx[72]);
2135
+ t1 = text(/*elemIndex*/ ctx[76]);
2991
2136
  t2 = space();
2992
- toggle_class(span, "selected", /*selectedElemIndex*/ ctx[4] === /*elemIndex*/ ctx[72]);
2137
+ toggle_class(span, "selected", /*selectedElemIndex*/ ctx[4] === /*elemIndex*/ ctx[76]);
2993
2138
  },
2994
2139
  m(target, anchor) {
2995
2140
  insert(target, span, anchor);
@@ -3006,7 +2151,7 @@ function create_each_block_5(ctx) {
3006
2151
  ctx = new_ctx;
3007
2152
 
3008
2153
  if (dirty[0] & /*selectedElemIndex*/ 16) {
3009
- toggle_class(span, "selected", /*selectedElemIndex*/ ctx[4] === /*elemIndex*/ ctx[72]);
2154
+ toggle_class(span, "selected", /*selectedElemIndex*/ ctx[4] === /*elemIndex*/ ctx[76]);
3010
2155
  }
3011
2156
  },
3012
2157
  d(detaching) {
@@ -3017,25 +2162,25 @@ function create_each_block_5(ctx) {
3017
2162
  };
3018
2163
  }
3019
2164
 
3020
- // (325:8) {#each getRuleNames(allRules[selectedElemIndex]) as ruleName, ruleIndex}
2165
+ // (377:8) {#each getRuleNames(allRules[selectedElemIndex]) as ruleName, ruleIndex}
3021
2166
  function create_each_block_4(ctx) {
3022
2167
  let span;
3023
- let t_value = /*ruleName*/ ctx[67] + "";
2168
+ let t_value = /*ruleName*/ ctx[71] + "";
3024
2169
  let t;
3025
2170
  let span_title_value;
3026
2171
  let mounted;
3027
2172
  let dispose;
3028
2173
 
3029
2174
  function click_handler_1() {
3030
- return /*click_handler_1*/ ctx[28](/*ruleIndex*/ ctx[69]);
2175
+ return /*click_handler_1*/ ctx[32](/*ruleIndex*/ ctx[73]);
3031
2176
  }
3032
2177
 
3033
2178
  return {
3034
2179
  c() {
3035
2180
  span = element("span");
3036
2181
  t = text(t_value);
3037
- attr(span, "title", span_title_value = /*ruleName*/ ctx[67]);
3038
- toggle_class(span, "selected", /*selectedRuleIndex*/ ctx[5] === /*ruleIndex*/ ctx[69]);
2182
+ attr(span, "title", span_title_value = /*ruleName*/ ctx[71]);
2183
+ toggle_class(span, "selected", /*selectedRuleIndex*/ ctx[5] === /*ruleIndex*/ ctx[73]);
3039
2184
  },
3040
2185
  m(target, anchor) {
3041
2186
  insert(target, span, anchor);
@@ -3048,14 +2193,14 @@ function create_each_block_4(ctx) {
3048
2193
  },
3049
2194
  p(new_ctx, dirty) {
3050
2195
  ctx = new_ctx;
3051
- if (dirty[0] & /*allRules, selectedElemIndex*/ 20 && t_value !== (t_value = /*ruleName*/ ctx[67] + "")) set_data(t, t_value);
2196
+ if (dirty[0] & /*allRules, selectedElemIndex*/ 20 && t_value !== (t_value = /*ruleName*/ ctx[71] + "")) set_data(t, t_value);
3052
2197
 
3053
- if (dirty[0] & /*allRules, selectedElemIndex*/ 20 && span_title_value !== (span_title_value = /*ruleName*/ ctx[67])) {
2198
+ if (dirty[0] & /*allRules, selectedElemIndex*/ 20 && span_title_value !== (span_title_value = /*ruleName*/ ctx[71])) {
3054
2199
  attr(span, "title", span_title_value);
3055
2200
  }
3056
2201
 
3057
2202
  if (dirty[0] & /*selectedRuleIndex*/ 32) {
3058
- toggle_class(span, "selected", /*selectedRuleIndex*/ ctx[5] === /*ruleIndex*/ ctx[69]);
2203
+ toggle_class(span, "selected", /*selectedRuleIndex*/ ctx[5] === /*ruleIndex*/ ctx[73]);
3059
2204
  }
3060
2205
  },
3061
2206
  d(detaching) {
@@ -3066,17 +2211,17 @@ function create_each_block_4(ctx) {
3066
2211
  };
3067
2212
  }
3068
2213
 
3069
- // (334:8) {#each allTypes[selectedElemIndex] || [] as type, typeIndex}
3070
- function create_each_block_3(ctx) {
2214
+ // (388:12) {#if type !== 'custom' || currentRule === 'inline'}
2215
+ function create_if_block_6(ctx) {
3071
2216
  let span;
3072
- let t0_value = /*type*/ ctx[64] + "";
2217
+ let t0_value = /*type*/ ctx[68] + "";
3073
2218
  let t0;
3074
2219
  let t1;
3075
2220
  let mounted;
3076
2221
  let dispose;
3077
2222
 
3078
2223
  function click_handler_2() {
3079
- return /*click_handler_2*/ ctx[29](/*typeIndex*/ ctx[66]);
2224
+ return /*click_handler_2*/ ctx[33](/*typeIndex*/ ctx[70]);
3080
2225
  }
3081
2226
 
3082
2227
  return {
@@ -3084,7 +2229,7 @@ function create_each_block_3(ctx) {
3084
2229
  span = element("span");
3085
2230
  t0 = text(t0_value);
3086
2231
  t1 = space();
3087
- toggle_class(span, "selected", /*selectedTypeIndex*/ ctx[6] === /*typeIndex*/ ctx[66]);
2232
+ toggle_class(span, "selected", /*selectedTypeIndex*/ ctx[6] === /*typeIndex*/ ctx[70]);
3088
2233
  },
3089
2234
  m(target, anchor) {
3090
2235
  insert(target, span, anchor);
@@ -3098,10 +2243,10 @@ function create_each_block_3(ctx) {
3098
2243
  },
3099
2244
  p(new_ctx, dirty) {
3100
2245
  ctx = new_ctx;
3101
- if (dirty[0] & /*allTypes, selectedElemIndex*/ 24 && t0_value !== (t0_value = /*type*/ ctx[64] + "")) set_data(t0, t0_value);
2246
+ if (dirty[0] & /*allTypes, selectedElemIndex*/ 24 && t0_value !== (t0_value = /*type*/ ctx[68] + "")) set_data(t0, t0_value);
3102
2247
 
3103
2248
  if (dirty[0] & /*selectedTypeIndex*/ 64) {
3104
- toggle_class(span, "selected", /*selectedTypeIndex*/ ctx[6] === /*typeIndex*/ ctx[66]);
2249
+ toggle_class(span, "selected", /*selectedTypeIndex*/ ctx[6] === /*typeIndex*/ ctx[70]);
3105
2250
  }
3106
2251
  },
3107
2252
  d(detaching) {
@@ -3112,7 +2257,42 @@ function create_each_block_3(ctx) {
3112
2257
  };
3113
2258
  }
3114
2259
 
3115
- // (338:4) {#if allTypes[selectedElemIndex]}
2260
+ // (386:8) {#each allTypes[selectedElemIndex] || [] as type, typeIndex}
2261
+ function create_each_block_3(ctx) {
2262
+ let if_block_anchor;
2263
+ let if_block = (/*type*/ ctx[68] !== 'custom' || /*currentRule*/ ctx[7] === 'inline') && create_if_block_6(ctx);
2264
+
2265
+ return {
2266
+ c() {
2267
+ if (if_block) if_block.c();
2268
+ if_block_anchor = empty();
2269
+ },
2270
+ m(target, anchor) {
2271
+ if (if_block) if_block.m(target, anchor);
2272
+ insert(target, if_block_anchor, anchor);
2273
+ },
2274
+ p(ctx, dirty) {
2275
+ if (/*type*/ ctx[68] !== 'custom' || /*currentRule*/ ctx[7] === 'inline') {
2276
+ if (if_block) {
2277
+ if_block.p(ctx, dirty);
2278
+ } else {
2279
+ if_block = create_if_block_6(ctx);
2280
+ if_block.c();
2281
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
2282
+ }
2283
+ } else if (if_block) {
2284
+ if_block.d(1);
2285
+ if_block = null;
2286
+ }
2287
+ },
2288
+ d(detaching) {
2289
+ if (if_block) if_block.d(detaching);
2290
+ if (detaching) detach(if_block_anchor);
2291
+ }
2292
+ };
2293
+ }
2294
+
2295
+ // (393:4) {#if allTypes[selectedElemIndex]}
3116
2296
  function create_if_block(ctx) {
3117
2297
  let div;
3118
2298
  let t;
@@ -3154,7 +2334,7 @@ function create_if_block(ctx) {
3154
2334
  current = true;
3155
2335
  },
3156
2336
  p(ctx, dirty) {
3157
- if (dirty[0] & /*allCurrentPropDefs, propsByType, updateCssRule*/ 155648) {
2337
+ if (dirty[0] & /*allCurrentPropDefs, propsByType, updateProp*/ 155648) {
3158
2338
  each_value = Object.entries(/*propsByType*/ ctx[13]);
3159
2339
  let i;
3160
2340
 
@@ -3220,10 +2400,10 @@ function create_if_block(ctx) {
3220
2400
  };
3221
2401
  }
3222
2402
 
3223
- // (349:16) {:else}
2403
+ // (404:16) {:else}
3224
2404
  function create_else_block(ctx) {
3225
2405
  let span;
3226
- let t_value = /*selectedName*/ ctx[55] + "";
2406
+ let t_value = /*selectedName*/ ctx[59] + "";
3227
2407
  let t;
3228
2408
 
3229
2409
  return {
@@ -3236,7 +2416,7 @@ function create_else_block(ctx) {
3236
2416
  append(span, t);
3237
2417
  },
3238
2418
  p(ctx, dirty) {
3239
- if (dirty[0] & /*propsByType*/ 8192 && t_value !== (t_value = /*selectedName*/ ctx[55] + "")) set_data(t, t_value);
2419
+ if (dirty[0] & /*propsByType*/ 8192 && t_value !== (t_value = /*selectedName*/ ctx[59] + "")) set_data(t, t_value);
3240
2420
  },
3241
2421
  d(detaching) {
3242
2422
  if (detaching) detach(span);
@@ -3244,13 +2424,13 @@ function create_else_block(ctx) {
3244
2424
  };
3245
2425
  }
3246
2426
 
3247
- // (343:16) {#if choices.props.length > 1}
2427
+ // (398:16) {#if choices.props.length > 1}
3248
2428
  function create_if_block_5(ctx) {
3249
2429
  let div;
3250
2430
  let select;
3251
2431
  let mounted;
3252
2432
  let dispose;
3253
- let each_value_2 = /*choices*/ ctx[54].props;
2433
+ let each_value_2 = /*choices*/ ctx[58].props;
3254
2434
  let each_blocks = [];
3255
2435
 
3256
2436
  for (let i = 0; i < each_value_2.length; i += 1) {
@@ -3258,7 +2438,7 @@ function create_if_block_5(ctx) {
3258
2438
  }
3259
2439
 
3260
2440
  function change_handler(...args) {
3261
- return /*change_handler*/ ctx[30](/*choices*/ ctx[54], /*each_value*/ ctx[56], /*each_index*/ ctx[57], ...args);
2441
+ return /*change_handler*/ ctx[34](/*choices*/ ctx[58], /*each_value*/ ctx[60], /*each_index*/ ctx[61], ...args);
3262
2442
  }
3263
2443
 
3264
2444
  return {
@@ -3287,7 +2467,7 @@ function create_if_block_5(ctx) {
3287
2467
  ctx = new_ctx;
3288
2468
 
3289
2469
  if (dirty[0] & /*propsByType*/ 8192) {
3290
- each_value_2 = /*choices*/ ctx[54].props;
2470
+ each_value_2 = /*choices*/ ctx[58].props;
3291
2471
  let i;
3292
2472
 
3293
2473
  for (i = 0; i < each_value_2.length; i += 1) {
@@ -3318,10 +2498,10 @@ function create_if_block_5(ctx) {
3318
2498
  };
3319
2499
  }
3320
2500
 
3321
- // (345:24) {#each choices.props as propName, i}
2501
+ // (400:24) {#each choices.props as propName, i}
3322
2502
  function create_each_block_2(ctx) {
3323
2503
  let option;
3324
- let t0_value = /*propName*/ ctx[61] + "";
2504
+ let t0_value = /*propName*/ ctx[65] + "";
3325
2505
  let t0;
3326
2506
  let t1;
3327
2507
  let option_selected_value;
@@ -3331,8 +2511,8 @@ function create_each_block_2(ctx) {
3331
2511
  option = element("option");
3332
2512
  t0 = text(t0_value);
3333
2513
  t1 = space();
3334
- option.selected = option_selected_value = /*i*/ ctx[63] === /*choices*/ ctx[54].selected;
3335
- option.__value = /*i*/ ctx[63];
2514
+ option.selected = option_selected_value = /*i*/ ctx[67] === /*choices*/ ctx[58].selected;
2515
+ option.__value = /*i*/ ctx[67];
3336
2516
  option.value = option.__value;
3337
2517
  },
3338
2518
  m(target, anchor) {
@@ -3341,9 +2521,9 @@ function create_each_block_2(ctx) {
3341
2521
  append(option, t1);
3342
2522
  },
3343
2523
  p(ctx, dirty) {
3344
- if (dirty[0] & /*propsByType*/ 8192 && t0_value !== (t0_value = /*propName*/ ctx[61] + "")) set_data(t0, t0_value);
2524
+ if (dirty[0] & /*propsByType*/ 8192 && t0_value !== (t0_value = /*propName*/ ctx[65] + "")) set_data(t0, t0_value);
3345
2525
 
3346
- if (dirty[0] & /*propsByType*/ 8192 && option_selected_value !== (option_selected_value = /*i*/ ctx[63] === /*choices*/ ctx[54].selected)) {
2526
+ if (dirty[0] & /*propsByType*/ 8192 && option_selected_value !== (option_selected_value = /*i*/ ctx[67] === /*choices*/ ctx[58].selected)) {
3347
2527
  option.selected = option_selected_value;
3348
2528
  }
3349
2529
  },
@@ -3353,18 +2533,18 @@ function create_each_block_2(ctx) {
3353
2533
  };
3354
2534
  }
3355
2535
 
3356
- // (364:46)
2536
+ // (421:46)
3357
2537
  function create_if_block_4(ctx) {
3358
2538
  let colorpicker;
3359
2539
  let current;
3360
2540
 
3361
2541
  function func(...args) {
3362
- return /*func*/ ctx[33](/*selectedName*/ ctx[55], ...args);
2542
+ return /*func*/ ctx[37](/*selectedName*/ ctx[59], ...args);
3363
2543
  }
3364
2544
 
3365
2545
  colorpicker = new ColorPicker$1({
3366
2546
  props: {
3367
- value: /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[55]].value,
2547
+ value: /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[59]].value,
3368
2548
  onChange: func
3369
2549
  }
3370
2550
  });
@@ -3380,7 +2560,7 @@ function create_if_block_4(ctx) {
3380
2560
  p(new_ctx, dirty) {
3381
2561
  ctx = new_ctx;
3382
2562
  const colorpicker_changes = {};
3383
- if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576) colorpicker_changes.value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[55]].value;
2563
+ if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576) colorpicker_changes.value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[59]].value;
3384
2564
  if (dirty[0] & /*propsByType*/ 8192) colorpicker_changes.onChange = func;
3385
2565
  colorpicker.$set(colorpicker_changes);
3386
2566
  },
@@ -3399,12 +2579,12 @@ function create_if_block_4(ctx) {
3399
2579
  };
3400
2580
  }
3401
2581
 
3402
- // (358:47)
2582
+ // (415:47)
3403
2583
  function create_if_block_3(ctx) {
3404
2584
  let select;
3405
2585
  let mounted;
3406
2586
  let dispose;
3407
- let each_value_1 = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[55]].choices();
2587
+ let each_value_1 = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[59]].choices();
3408
2588
  let each_blocks = [];
3409
2589
 
3410
2590
  for (let i = 0; i < each_value_1.length; i += 1) {
@@ -3412,7 +2592,7 @@ function create_if_block_3(ctx) {
3412
2592
  }
3413
2593
 
3414
2594
  function change_handler_2(...args) {
3415
- return /*change_handler_2*/ ctx[32](/*selectedName*/ ctx[55], ...args);
2595
+ return /*change_handler_2*/ ctx[36](/*selectedName*/ ctx[59], ...args);
3416
2596
  }
3417
2597
 
3418
2598
  return {
@@ -3439,7 +2619,7 @@ function create_if_block_3(ctx) {
3439
2619
  ctx = new_ctx;
3440
2620
 
3441
2621
  if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576) {
3442
- each_value_1 = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[55]].choices();
2622
+ each_value_1 = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[59]].choices();
3443
2623
  let i;
3444
2624
 
3445
2625
  for (i = 0; i < each_value_1.length; i += 1) {
@@ -3472,21 +2652,22 @@ function create_if_block_3(ctx) {
3472
2652
  };
3473
2653
  }
3474
2654
 
3475
- // (352:16) {#if propType === 'slider'}
2655
+ // (407:16) {#if propType === 'slider'}
3476
2656
  function create_if_block_2(ctx) {
3477
2657
  let input;
3478
- let input_value_value;
3479
2658
  let input_min_value;
3480
2659
  let input_max_value;
2660
+ let input_step_value;
2661
+ let input_value_value;
3481
2662
  let t0;
3482
2663
  let span;
3483
- let t1_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[55]].displayed + "";
2664
+ let t1_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[59]].displayed + "";
3484
2665
  let t1;
3485
2666
  let mounted;
3486
2667
  let dispose;
3487
2668
 
3488
2669
  function change_handler_1(...args) {
3489
- return /*change_handler_1*/ ctx[31](/*selectedName*/ ctx[55], ...args);
2670
+ return /*change_handler_1*/ ctx[35](/*selectedName*/ ctx[59], ...args);
3490
2671
  }
3491
2672
 
3492
2673
  return {
@@ -3496,9 +2677,10 @@ function create_if_block_2(ctx) {
3496
2677
  span = element("span");
3497
2678
  t1 = text(t1_value);
3498
2679
  attr(input, "type", "range");
3499
- input.value = input_value_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[55]].value;
3500
- attr(input, "min", input_min_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[55]].min);
3501
- attr(input, "max", input_max_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[55]].max);
2680
+ attr(input, "min", input_min_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[59]].min);
2681
+ attr(input, "max", input_max_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[59]].max);
2682
+ attr(input, "step", input_step_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[59]].step || 1);
2683
+ input.value = input_value_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[59]].value;
3502
2684
  attr(span, "class", "current-value");
3503
2685
  },
3504
2686
  m(target, anchor) {
@@ -3515,19 +2697,23 @@ function create_if_block_2(ctx) {
3515
2697
  p(new_ctx, dirty) {
3516
2698
  ctx = new_ctx;
3517
2699
 
3518
- if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576 && input_value_value !== (input_value_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[55]].value)) {
3519
- input.value = input_value_value;
3520
- }
3521
-
3522
- if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576 && input_min_value !== (input_min_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[55]].min)) {
2700
+ if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576 && input_min_value !== (input_min_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[59]].min)) {
3523
2701
  attr(input, "min", input_min_value);
3524
2702
  }
3525
2703
 
3526
- if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576 && input_max_value !== (input_max_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[55]].max)) {
2704
+ if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576 && input_max_value !== (input_max_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[59]].max)) {
3527
2705
  attr(input, "max", input_max_value);
3528
2706
  }
3529
2707
 
3530
- if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576 && t1_value !== (t1_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[55]].displayed + "")) set_data(t1, t1_value);
2708
+ if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576 && input_step_value !== (input_step_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[59]].step || 1)) {
2709
+ attr(input, "step", input_step_value);
2710
+ }
2711
+
2712
+ if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576 && input_value_value !== (input_value_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[59]].value)) {
2713
+ input.value = input_value_value;
2714
+ }
2715
+
2716
+ if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576 && t1_value !== (t1_value = /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[59]].displayed + "")) set_data(t1, t1_value);
3531
2717
  },
3532
2718
  i: noop$1,
3533
2719
  o: noop$1,
@@ -3541,10 +2727,10 @@ function create_if_block_2(ctx) {
3541
2727
  };
3542
2728
  }
3543
2729
 
3544
- // (360:24) {#each allCurrentPropDefs[selectedName].choices() as choice}
2730
+ // (417:24) {#each allCurrentPropDefs[selectedName].choices() as choice}
3545
2731
  function create_each_block_1(ctx) {
3546
2732
  let option;
3547
- let t_value = /*choice*/ ctx[58] + "";
2733
+ let t_value = /*choice*/ ctx[62] + "";
3548
2734
  let t;
3549
2735
  let option_selected_value;
3550
2736
  let option_value_value;
@@ -3553,8 +2739,8 @@ function create_each_block_1(ctx) {
3553
2739
  c() {
3554
2740
  option = element("option");
3555
2741
  t = text(t_value);
3556
- option.selected = option_selected_value = /*choice*/ ctx[58] == /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[55]].value || null;
3557
- option.__value = option_value_value = " " + /*choice*/ ctx[58] + " ";
2742
+ option.selected = option_selected_value = /*choice*/ ctx[62] == /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[59]].value || null;
2743
+ option.__value = option_value_value = " " + /*choice*/ ctx[62] + " ";
3558
2744
  option.value = option.__value;
3559
2745
  },
3560
2746
  m(target, anchor) {
@@ -3562,13 +2748,13 @@ function create_each_block_1(ctx) {
3562
2748
  append(option, t);
3563
2749
  },
3564
2750
  p(ctx, dirty) {
3565
- if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576 && t_value !== (t_value = /*choice*/ ctx[58] + "")) set_data(t, t_value);
2751
+ if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576 && t_value !== (t_value = /*choice*/ ctx[62] + "")) set_data(t, t_value);
3566
2752
 
3567
- if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576 && option_selected_value !== (option_selected_value = /*choice*/ ctx[58] == /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[55]].value || null)) {
2753
+ if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576 && option_selected_value !== (option_selected_value = /*choice*/ ctx[62] == /*allCurrentPropDefs*/ ctx[14][/*selectedName*/ ctx[59]].value || null)) {
3568
2754
  option.selected = option_selected_value;
3569
2755
  }
3570
2756
 
3571
- if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576 && option_value_value !== (option_value_value = " " + /*choice*/ ctx[58] + " ")) {
2757
+ if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 24576 && option_value_value !== (option_value_value = " " + /*choice*/ ctx[62] + " ")) {
3572
2758
  option.__value = option_value_value;
3573
2759
  option.value = option.__value;
3574
2760
  }
@@ -3579,7 +2765,7 @@ function create_each_block_1(ctx) {
3579
2765
  };
3580
2766
  }
3581
2767
 
3582
- // (340:8) {#each Object.entries(propsByType) as [propType, choices]}
2768
+ // (395:8) {#each Object.entries(propsByType) as [propType, choices]}
3583
2769
  function create_each_block(ctx) {
3584
2770
  let div;
3585
2771
  let t;
@@ -3588,7 +2774,7 @@ function create_each_block(ctx) {
3588
2774
  let current;
3589
2775
 
3590
2776
  function select_block_type(ctx, dirty) {
3591
- if (/*choices*/ ctx[54].props.length > 1) return create_if_block_5;
2777
+ if (/*choices*/ ctx[58].props.length > 1) return create_if_block_5;
3592
2778
  return create_else_block;
3593
2779
  }
3594
2780
 
@@ -3598,9 +2784,9 @@ function create_each_block(ctx) {
3598
2784
  const if_blocks = [];
3599
2785
 
3600
2786
  function select_block_type_1(ctx, dirty) {
3601
- if (/*propType*/ ctx[53] === 'slider') return 0;
3602
- if (/*propType*/ ctx[53] == 'select') return 1;
3603
- if (/*propType*/ ctx[53] == 'color') return 2;
2787
+ if (/*propType*/ ctx[57] === 'slider') return 0;
2788
+ if (/*propType*/ ctx[57] == 'select') return 1;
2789
+ if (/*propType*/ ctx[57] == 'color') return 2;
3604
2790
  return -1;
3605
2791
  }
3606
2792
 
@@ -3695,7 +2881,7 @@ function create_each_block(ctx) {
3695
2881
  };
3696
2882
  }
3697
2883
 
3698
- // (372:8) {#if currentRule === 'inline' && bringableToFront[selectedElemIndex] !== null}
2884
+ // (429:8) {#if currentRule === 'inline' && bringableToFront[selectedElemIndex] !== null}
3699
2885
  function create_if_block_1(ctx) {
3700
2886
  let div;
3701
2887
  let mounted;
@@ -3754,7 +2940,7 @@ function create_fragment(ctx) {
3754
2940
  let current;
3755
2941
  let mounted;
3756
2942
  let dispose;
3757
- let if_block0 = /*targetsToSearch*/ ctx[1].length > 1 && create_if_block_6(ctx);
2943
+ let if_block0 = /*targetsToSearch*/ ctx[1].length > 1 && create_if_block_7(ctx);
3758
2944
  let each_value_4 = getRuleNames(/*allRules*/ ctx[2][/*selectedElemIndex*/ ctx[4]]);
3759
2945
  let each_blocks_1 = [];
3760
2946
 
@@ -3829,13 +3015,13 @@ function create_fragment(ctx) {
3829
3015
  },
3830
3016
  m(target, anchor) {
3831
3017
  insert(target, div0, anchor);
3832
- /*div0_binding*/ ctx[25](div0);
3018
+ /*div0_binding*/ ctx[29](div0);
3833
3019
  insert(target, t0, anchor);
3834
3020
  insert(target, svg, anchor);
3835
3021
  append(svg, clipPath);
3836
3022
  append(clipPath, path);
3837
3023
  append(svg, rect);
3838
- /*svg_binding*/ ctx[26](svg);
3024
+ /*svg_binding*/ ctx[30](svg);
3839
3025
  insert(target, t1, anchor);
3840
3026
  insert(target, div4, anchor);
3841
3027
  append(div4, div1);
@@ -3861,7 +3047,7 @@ function create_fragment(ctx) {
3861
3047
 
3862
3048
  append(div4, t10);
3863
3049
  if (if_block1) if_block1.m(div4, null);
3864
- /*div4_binding*/ ctx[34](div4);
3050
+ /*div4_binding*/ ctx[38](div4);
3865
3051
  current = true;
3866
3052
 
3867
3053
  if (!mounted) {
@@ -3890,7 +3076,7 @@ function create_fragment(ctx) {
3890
3076
  if (if_block0) {
3891
3077
  if_block0.p(ctx, dirty);
3892
3078
  } else {
3893
- if_block0 = create_if_block_6(ctx);
3079
+ if_block0 = create_if_block_7(ctx);
3894
3080
  if_block0.c();
3895
3081
  if_block0.m(div4, t4);
3896
3082
  }
@@ -3899,7 +3085,7 @@ function create_fragment(ctx) {
3899
3085
  if_block0 = null;
3900
3086
  }
3901
3087
 
3902
- if (dirty[0] & /*allRules, selectedElemIndex, selectedRuleIndex*/ 52) {
3088
+ if (dirty[0] & /*allRules, selectedElemIndex, selectedRuleIndex, selectRule*/ 524340) {
3903
3089
  each_value_4 = getRuleNames(/*allRules*/ ctx[2][/*selectedElemIndex*/ ctx[4]]);
3904
3090
  let i;
3905
3091
 
@@ -3922,7 +3108,7 @@ function create_fragment(ctx) {
3922
3108
  each_blocks_1.length = each_value_4.length;
3923
3109
  }
3924
3110
 
3925
- if (dirty[0] & /*selectedTypeIndex, allTypes, selectedElemIndex*/ 88) {
3111
+ if (dirty[0] & /*selectedTypeIndex, allTypes, selectedElemIndex, currentRule*/ 216) {
3926
3112
  each_value_3 = /*allTypes*/ ctx[3][/*selectedElemIndex*/ ctx[4]] || [];
3927
3113
  let i;
3928
3114
 
@@ -3979,17 +3165,17 @@ function create_fragment(ctx) {
3979
3165
  },
3980
3166
  d(detaching) {
3981
3167
  if (detaching) detach(div0);
3982
- /*div0_binding*/ ctx[25](null);
3168
+ /*div0_binding*/ ctx[29](null);
3983
3169
  if (detaching) detach(t0);
3984
3170
  if (detaching) detach(svg);
3985
- /*svg_binding*/ ctx[26](null);
3171
+ /*svg_binding*/ ctx[30](null);
3986
3172
  if (detaching) detach(t1);
3987
3173
  if (detaching) detach(div4);
3988
3174
  if (if_block0) if_block0.d();
3989
3175
  destroy_each(each_blocks_1, detaching);
3990
3176
  destroy_each(each_blocks, detaching);
3991
3177
  if (if_block1) if_block1.d();
3992
- /*div4_binding*/ ctx[34](null);
3178
+ /*div4_binding*/ ctx[38](null);
3993
3179
  mounted = false;
3994
3180
  run_all(dispose);
3995
3181
  }
@@ -4000,6 +3186,7 @@ const typeText = "text";
4000
3186
  const typeBorder = "border";
4001
3187
  const typeStroke = "stroke";
4002
3188
  const typeBackground = "background";
3189
+ const customType = "custom";
4003
3190
 
4004
3191
  function getRuleNames(rules) {
4005
3192
  if (!rules) return [];
@@ -4124,15 +3311,23 @@ function instance($$self, $$props, $$invalidate) {
4124
3311
  "background-color": { type: "color" }
4125
3312
  };
4126
3313
 
3314
+ let { getAdditionalElems = () => [] } = $$props;
3315
+ let { listenOnClick = false } = $$props;
3316
+
3317
+ let { onStyleChanged = () => {
3318
+
3319
+ } } = $$props;
3320
+
3321
+ let { customProps = {} } = $$props;
3322
+
4127
3323
  const propByType = {
4128
3324
  [typeText]: fontProps,
4129
3325
  [typeBorder]: borderProps,
4130
3326
  [typeStroke]: pathProps,
4131
- [typeBackground]: backgroundProps
3327
+ [typeBackground]: backgroundProps,
3328
+ [customType]: Object.keys(customProps)
4132
3329
  };
4133
3330
 
4134
- let { getAdditionalElems = () => [] } = $$props;
4135
- let { listenOnClick = false } = $$props;
4136
3331
  let elementToListen = null;
4137
3332
  let positionAnchor;
4138
3333
  let self;
@@ -4154,11 +3349,20 @@ function instance($$self, $$props, $$invalidate) {
4154
3349
 
4155
3350
  onMount(() => {
4156
3351
  close();
4157
- $$invalidate(22, elementToListen = self.parentNode);
3352
+ $$invalidate(26, elementToListen = self.parentNode);
4158
3353
  document.body.appendChild(self);
4159
3354
  document.body.appendChild(helperElemWrapper);
4160
3355
  document.body.appendChild(positionAnchor);
4161
3356
  udpatePageDimensions();
3357
+
3358
+ // make sure the layout is computed to get the client size
3359
+ setTimeout(
3360
+ () => {
3361
+ udpatePageDimensions();
3362
+ },
3363
+ 1000
3364
+ );
3365
+
4162
3366
  window.addEventListener('resize', udpatePageDimensions);
4163
3367
  });
4164
3368
 
@@ -4261,6 +3465,10 @@ function instance($$self, $$props, $$invalidate) {
4261
3465
  $$invalidate(3, allTypes = getEditableTypes(targetsToSearch));
4262
3466
  $$invalidate(2, allRules = getMatchedCSSRules(targetsToSearch));
4263
3467
 
3468
+ if (Object.keys(customProps).length) {
3469
+ allTypes[0].push(customType);
3470
+ }
3471
+
4264
3472
  if (x && y) show(x, y); else {
4265
3473
  const rect = getBoundingBoxInfos(el, 15);
4266
3474
  show(rect.left, rect.top);
@@ -4270,6 +3478,11 @@ function instance($$self, $$props, $$invalidate) {
4270
3478
  function close() {
4271
3479
  $$invalidate(9, self.style.display = "none", self);
4272
3480
  $$invalidate(10, helperElemWrapper.style.display = "none", helperElemWrapper);
3481
+ $$invalidate(11, pathWithHoles = '');
3482
+ }
3483
+
3484
+ function isOpened() {
3485
+ return self.style.display === 'block';
4273
3486
  }
4274
3487
 
4275
3488
  function overlayClicked() {
@@ -4304,25 +3517,36 @@ function instance($$self, $$props, $$invalidate) {
4304
3517
  $$invalidate(11, pathWithHoles = computeContours(boundingBoxes, pageDimensions));
4305
3518
  }
4306
3519
 
4307
- function _updateCssRule(cssPropName, val, suffix) {
3520
+ function _updateProp(propName, val, suffix) {
4308
3521
  const finalValue = suffix ? val + suffix : val;
4309
3522
 
4310
3523
  if (currentRule === 'inline') {
4311
- const style = currentElement.style; // do not trigger reactivity on currentElement
4312
- style[cssPropName] = finalValue;
4313
- } else currentRule.style.setProperty(cssPropName, finalValue);
3524
+ if (allCurrentPropDefs[propName].setter) {
3525
+ allCurrentPropDefs[propName].setter(currentElement, val);
3526
+ } else {
3527
+ const style = currentElement.style; // do not trigger reactivity on currentElement
3528
+ style[propName] = finalValue;
3529
+ }
3530
+ } else currentRule.style.setProperty(propName, finalValue);
4314
3531
 
4315
- $$invalidate(14, allCurrentPropDefs[cssPropName].value = val, allCurrentPropDefs);
4316
- $$invalidate(14, allCurrentPropDefs[cssPropName].displayed = finalValue, allCurrentPropDefs);
3532
+ $$invalidate(14, allCurrentPropDefs[propName].value = val, allCurrentPropDefs);
3533
+ $$invalidate(14, allCurrentPropDefs[propName].displayed = finalValue, allCurrentPropDefs);
3534
+ onStyleChanged(currentElement, currentRule, propName, finalValue);
4317
3535
  updateHelpers();
4318
3536
  }
4319
3537
 
4320
- const updateCssRule = lodash_debounce(_updateCssRule, 100);
3538
+ const updateProp = debounce(_updateProp, 100);
4321
3539
 
4322
3540
  function udpatePageDimensions() {
3541
+ const bodyStyle = getComputedStyle(document.body);
3542
+ const marginLeft = parseInt(bodyStyle.marginLeft);
3543
+ const marginRight = parseInt(bodyStyle.marginRight);
3544
+ const marginTop = parseInt(bodyStyle.marginTop);
3545
+ const marginBottom = parseInt(bodyStyle.marginBottom);
3546
+
4323
3547
  $$invalidate(12, pageDimensions = {
4324
- width: document.body.scrollWidth,
4325
- height: document.body.scrollHeight
3548
+ width: document.body.offsetWidth + marginLeft + marginRight,
3549
+ height: document.body.offsetHeight + marginTop + marginBottom
4326
3550
  });
4327
3551
  }
4328
3552
 
@@ -4342,6 +3566,16 @@ function instance($$self, $$props, $$invalidate) {
4342
3566
  currentElement.parentNode.appendChild(currentElement);
4343
3567
  }
4344
3568
 
3569
+ function selectRule(ruleIndex) {
3570
+ const newRule = allRules[selectedElemIndex]?.[ruleIndex];
3571
+
3572
+ if (newRule !== 'inline' && selectedTypeIndex === allTypes[selectedElemIndex].length - 1) {
3573
+ $$invalidate(6, selectedTypeIndex = 0);
3574
+ }
3575
+
3576
+ $$invalidate(5, selectedRuleIndex = ruleIndex);
3577
+ }
3578
+
4345
3579
  function div0_binding($$value) {
4346
3580
  binding_callbacks[$$value ? 'unshift' : 'push'](() => {
4347
3581
  positionAnchor = $$value;
@@ -4362,17 +3596,21 @@ function instance($$self, $$props, $$invalidate) {
4362
3596
  };
4363
3597
 
4364
3598
  const click_handler_1 = ruleIndex => {
4365
- $$invalidate(5, selectedRuleIndex = ruleIndex);
3599
+ selectRule(ruleIndex);
4366
3600
  };
4367
3601
 
4368
3602
  const click_handler_2 = typeIndex => {
4369
3603
  $$invalidate(6, selectedTypeIndex = typeIndex);
4370
3604
  };
4371
3605
 
4372
- const change_handler = (choices, each_value, each_index, e) => $$invalidate(13, each_value[each_index][1].selected = e.target.value, propsByType);
4373
- const change_handler_1 = (selectedName, e) => updateCssRule(selectedName, e.target.value, allCurrentPropDefs[selectedName].suffix, e.target);
4374
- const change_handler_2 = (selectedName, e) => updateCssRule(selectedName, e.target.value);
4375
- const func = (selectedName, color) => updateCssRule(selectedName, color);
3606
+ const change_handler = async (choices, each_value, each_index, e) => {
3607
+ $$invalidate(13, each_value[each_index][1].selected = e.target.value, propsByType);
3608
+ await tick();
3609
+ };
3610
+
3611
+ const change_handler_1 = (selectedName, e) => updateProp(selectedName, e.target.value, allCurrentPropDefs[selectedName].suffix, e.target);
3612
+ const change_handler_2 = (selectedName, e) => updateProp(selectedName, e.target.value);
3613
+ const func = (selectedName, color) => updateProp(selectedName, color);
4376
3614
 
4377
3615
  function div4_binding($$value) {
4378
3616
  binding_callbacks[$$value ? 'unshift' : 'push'](() => {
@@ -4382,12 +3620,14 @@ function instance($$self, $$props, $$invalidate) {
4382
3620
  }
4383
3621
 
4384
3622
  $$self.$$set = $$props => {
4385
- if ('getAdditionalElems' in $$props) $$invalidate(19, getAdditionalElems = $$props.getAdditionalElems);
4386
- if ('listenOnClick' in $$props) $$invalidate(20, listenOnClick = $$props.listenOnClick);
3623
+ if ('getAdditionalElems' in $$props) $$invalidate(20, getAdditionalElems = $$props.getAdditionalElems);
3624
+ if ('listenOnClick' in $$props) $$invalidate(21, listenOnClick = $$props.listenOnClick);
3625
+ if ('onStyleChanged' in $$props) $$invalidate(22, onStyleChanged = $$props.onStyleChanged);
3626
+ if ('customProps' in $$props) $$invalidate(23, customProps = $$props.customProps);
4387
3627
  };
4388
3628
 
4389
3629
  $$self.$$.update = () => {
4390
- if ($$self.$$.dirty[0] & /*elementToListen*/ 4194304) {
3630
+ if ($$self.$$.dirty[0] & /*elementToListen*/ 67108864) {
4391
3631
  {
4392
3632
  if (elementToListen !== null) {
4393
3633
  init();
@@ -4396,32 +3636,46 @@ function instance($$self, $$props, $$invalidate) {
4396
3636
  }
4397
3637
 
4398
3638
  if ($$self.$$.dirty[0] & /*targetsToSearch, selectedElemIndex*/ 18) {
4399
- $$invalidate(24, currentElement = targetsToSearch[selectedElemIndex]);
3639
+ $$invalidate(28, currentElement = targetsToSearch[selectedElemIndex]);
4400
3640
  }
4401
3641
 
4402
3642
  if ($$self.$$.dirty[0] & /*allRules, selectedElemIndex, selectedRuleIndex*/ 52) {
4403
3643
  $$invalidate(7, currentRule = allRules[selectedElemIndex]?.[selectedRuleIndex]);
4404
3644
  }
4405
3645
 
4406
- if ($$self.$$.dirty[0] & /*allTypes, selectedElemIndex, selectedTypeIndex, curType*/ 8388696) {
3646
+ if ($$self.$$.dirty[0] & /*allTypes, selectedElemIndex, selectedTypeIndex, curType*/ 134217816) {
4407
3647
  {
4408
3648
  if (allTypes[selectedElemIndex]?.[selectedTypeIndex] !== curType) {
4409
- $$invalidate(23, curType = allTypes[selectedElemIndex]?.[selectedTypeIndex]);
3649
+ $$invalidate(27, curType = allTypes[selectedElemIndex]?.[selectedTypeIndex]);
4410
3650
  }
4411
3651
  }
4412
3652
  }
4413
3653
 
4414
- if ($$self.$$.dirty[0] & /*curType, currentRule, currentElement*/ 25165952) {
3654
+ if ($$self.$$.dirty[0] & /*curType, currentRule, customProps, currentElement*/ 411041920) {
4415
3655
  {
4416
3656
  if (curType && currentRule) {
4417
- const _allCurrentPropDefs = lodash_pick(cssPropByType, propByType[curType]);
3657
+ const allProps = { ...cssPropByType, ...customProps };
3658
+ const _allCurrentPropDefs = pick(allProps, propByType[curType]);
4418
3659
 
4419
3660
  Object.keys(_allCurrentPropDefs).forEach(key => {
4420
- _allCurrentPropDefs[key].displayed = getComputedPropValue(currentElement, key, 'raw');
4421
3661
  const propSelectType = _allCurrentPropDefs[key].type;
4422
3662
  let retrieveType = 'number';
4423
3663
  if (propSelectType === 'color') retrieveType = 'rgb'; else if (propSelectType === 'select') retrieveType = 'raw';
4424
- _allCurrentPropDefs[key].value = getComputedPropValue(currentElement, key, retrieveType);
3664
+
3665
+ if (_allCurrentPropDefs[key].getter) {
3666
+ const val = _allCurrentPropDefs[key].getter(currentElement);
3667
+
3668
+ if (val === null) {
3669
+ delete _allCurrentPropDefs[key];
3670
+ return;
3671
+ }
3672
+
3673
+ _allCurrentPropDefs[key].value = val;
3674
+ _allCurrentPropDefs[key].displayed = val;
3675
+ } else {
3676
+ _allCurrentPropDefs[key].displayed = getComputedPropValue(currentElement, key, 'raw');
3677
+ _allCurrentPropDefs[key].value = getComputedPropValue(currentElement, key, retrieveType);
3678
+ }
4425
3679
  });
4426
3680
 
4427
3681
  $$invalidate(13, propsByType = Object.entries(_allCurrentPropDefs).reduce(
@@ -4457,11 +3711,15 @@ function instance($$self, $$props, $$invalidate) {
4457
3711
  allCurrentPropDefs,
4458
3712
  bringableToFront,
4459
3713
  overlayClicked,
4460
- updateCssRule,
3714
+ updateProp,
4461
3715
  bringToFront,
3716
+ selectRule,
4462
3717
  getAdditionalElems,
4463
3718
  listenOnClick,
3719
+ onStyleChanged,
3720
+ customProps,
4464
3721
  open,
3722
+ isOpened,
4465
3723
  elementToListen,
4466
3724
  curType,
4467
3725
  currentElement,
@@ -4489,10 +3747,13 @@ class InlineStyleEditor$1 extends SvelteComponent {
4489
3747
  create_fragment,
4490
3748
  safe_not_equal,
4491
3749
  {
4492
- getAdditionalElems: 19,
4493
- listenOnClick: 20,
4494
- open: 21,
4495
- close: 0
3750
+ getAdditionalElems: 20,
3751
+ listenOnClick: 21,
3752
+ onStyleChanged: 22,
3753
+ customProps: 23,
3754
+ open: 24,
3755
+ close: 0,
3756
+ isOpened: 25
4496
3757
  },
4497
3758
  null,
4498
3759
  [-1, -1, -1]
@@ -4500,12 +3761,16 @@ class InlineStyleEditor$1 extends SvelteComponent {
4500
3761
  }
4501
3762
 
4502
3763
  get open() {
4503
- return this.$$.ctx[21];
3764
+ return this.$$.ctx[24];
4504
3765
  }
4505
3766
 
4506
3767
  get close() {
4507
3768
  return this.$$.ctx[0];
4508
3769
  }
3770
+
3771
+ get isOpened() {
3772
+ return this.$$.ctx[25];
3773
+ }
4509
3774
  }
4510
3775
 
4511
3776
  var StyleEditor = InlineStyleEditor$1;