inline-style-editor 1.2.9 → 1.2.11

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.
@@ -2042,6 +2042,13 @@ function get_each_context_1(ctx, list, i) {
2042
2042
  return child_ctx;
2043
2043
  }
2044
2044
 
2045
+ function get_if_ctx(ctx) {
2046
+ const child_ctx = ctx.slice();
2047
+ const constants_0 = /*allCurrentPropDefs*/ child_ctx[13][/*selectedName*/ child_ctx[63]].choices();
2048
+ child_ctx[62] = constants_0;
2049
+ return child_ctx;
2050
+ }
2051
+
2045
2052
  function get_each_context_2(ctx, list, i) {
2046
2053
  const child_ctx = ctx.slice();
2047
2054
  child_ctx[69] = list[i];
@@ -2071,7 +2078,7 @@ function get_each_context_5(ctx, list, i) {
2071
2078
  }
2072
2079
 
2073
2080
  // (396:4) {#if targetsToSearch.length > 1}
2074
- function create_if_block_7(ctx) {
2081
+ function create_if_block_8(ctx) {
2075
2082
  let div;
2076
2083
  let b;
2077
2084
  let t1;
@@ -2232,7 +2239,7 @@ function create_each_block_4(ctx) {
2232
2239
  }
2233
2240
 
2234
2241
  // (419:12) {#if type !== 'custom' || (currentRule === 'inline' && type === 'custom' && hasDisplayedCustom )}
2235
- function create_if_block_6(ctx) {
2242
+ function create_if_block_7(ctx) {
2236
2243
  let span;
2237
2244
  let t0_value = /*type*/ ctx[72] + "";
2238
2245
  let t0;
@@ -2280,7 +2287,7 @@ function create_if_block_6(ctx) {
2280
2287
  // (417:8) {#each allTypes[selectedElemIndex] || [] as type, typeIndex}
2281
2288
  function create_each_block_3(ctx) {
2282
2289
  let if_block_anchor;
2283
- let if_block = (/*type*/ ctx[72] !== 'custom' || /*currentRule*/ ctx[16] === 'inline' && /*type*/ ctx[72] === 'custom' && /*hasDisplayedCustom*/ ctx[15]) && create_if_block_6(ctx);
2290
+ let if_block = (/*type*/ ctx[72] !== 'custom' || /*currentRule*/ ctx[16] === 'inline' && /*type*/ ctx[72] === 'custom' && /*hasDisplayedCustom*/ ctx[15]) && create_if_block_7(ctx);
2284
2291
 
2285
2292
  return {
2286
2293
  c() {
@@ -2296,7 +2303,7 @@ function create_each_block_3(ctx) {
2296
2303
  if (if_block) {
2297
2304
  if_block.p(ctx, dirty);
2298
2305
  } else {
2299
- if_block = create_if_block_6(ctx);
2306
+ if_block = create_if_block_7(ctx);
2300
2307
  if_block.c();
2301
2308
  if_block.m(if_block_anchor.parentNode, if_block_anchor);
2302
2309
  }
@@ -2445,7 +2452,7 @@ function create_else_block(ctx) {
2445
2452
  }
2446
2453
 
2447
2454
  // (429:16) {#if choices.props.length > 1}
2448
- function create_if_block_5(ctx) {
2455
+ function create_if_block_6(ctx) {
2449
2456
  let div;
2450
2457
  let select;
2451
2458
  let mounted;
@@ -2553,8 +2560,8 @@ function create_each_block_2(ctx) {
2553
2560
  };
2554
2561
  }
2555
2562
 
2556
- // (454:46)
2557
- function create_if_block_4(ctx) {
2563
+ // (458:46)
2564
+ function create_if_block_5(ctx) {
2558
2565
  let colorpicker;
2559
2566
  let current;
2560
2567
 
@@ -2602,9 +2609,12 @@ function create_if_block_4(ctx) {
2602
2609
  // (448:47)
2603
2610
  function create_if_block_3(ctx) {
2604
2611
  let select;
2612
+ let show_if = !/*choices*/ ctx[62].includes(/*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].value);
2613
+ let if_block_anchor;
2605
2614
  let mounted;
2606
2615
  let dispose;
2607
- let each_value_1 = /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].choices();
2616
+ let if_block = show_if && create_if_block_4();
2617
+ let each_value_1 = /*choices*/ ctx[62];
2608
2618
  let each_blocks = [];
2609
2619
 
2610
2620
  for (let i = 0; i < each_value_1.length; i += 1) {
@@ -2618,6 +2628,8 @@ function create_if_block_3(ctx) {
2618
2628
  return {
2619
2629
  c() {
2620
2630
  select = element("select");
2631
+ if (if_block) if_block.c();
2632
+ if_block_anchor = empty();
2621
2633
 
2622
2634
  for (let i = 0; i < each_blocks.length; i += 1) {
2623
2635
  each_blocks[i].c();
@@ -2625,6 +2637,8 @@ function create_if_block_3(ctx) {
2625
2637
  },
2626
2638
  m(target, anchor) {
2627
2639
  insert(target, select, anchor);
2640
+ if (if_block) if_block.m(select, null);
2641
+ append(select, if_block_anchor);
2628
2642
 
2629
2643
  for (let i = 0; i < each_blocks.length; i += 1) {
2630
2644
  each_blocks[i].m(select, null);
@@ -2637,9 +2651,21 @@ function create_if_block_3(ctx) {
2637
2651
  },
2638
2652
  p(new_ctx, dirty) {
2639
2653
  ctx = new_ctx;
2654
+ if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 12288) show_if = !/*choices*/ ctx[62].includes(/*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].value);
2655
+
2656
+ if (show_if) {
2657
+ if (if_block) ; else {
2658
+ if_block = create_if_block_4();
2659
+ if_block.c();
2660
+ if_block.m(select, if_block_anchor);
2661
+ }
2662
+ } else if (if_block) {
2663
+ if_block.d(1);
2664
+ if_block = null;
2665
+ }
2640
2666
 
2641
2667
  if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 12288) {
2642
- each_value_1 = /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].choices();
2668
+ each_value_1 = /*choices*/ ctx[62];
2643
2669
  let i;
2644
2670
 
2645
2671
  for (i = 0; i < each_value_1.length; i += 1) {
@@ -2665,6 +2691,7 @@ function create_if_block_3(ctx) {
2665
2691
  o: noop$1,
2666
2692
  d(detaching) {
2667
2693
  if (detaching) detach(select);
2694
+ if (if_block) if_block.d();
2668
2695
  destroy_each(each_blocks, detaching);
2669
2696
  mounted = false;
2670
2697
  dispose();
@@ -2747,7 +2774,28 @@ function create_if_block_2(ctx) {
2747
2774
  };
2748
2775
  }
2749
2776
 
2750
- // (450:24) {#each allCurrentPropDefs[selectedName].choices() as choice}
2777
+ // (451:24) {#if !choices.includes(allCurrentPropDefs[selectedName].value)}
2778
+ function create_if_block_4(ctx) {
2779
+ let option;
2780
+
2781
+ return {
2782
+ c() {
2783
+ option = element("option");
2784
+ option.textContent = "--- ";
2785
+ option.selected = "true";
2786
+ option.__value = " --- ";
2787
+ option.value = option.__value;
2788
+ },
2789
+ m(target, anchor) {
2790
+ insert(target, option, anchor);
2791
+ },
2792
+ d(detaching) {
2793
+ if (detaching) detach(option);
2794
+ }
2795
+ };
2796
+ }
2797
+
2798
+ // (454:24) {#each choices as choice}
2751
2799
  function create_each_block_1(ctx) {
2752
2800
  let option;
2753
2801
  let t_value = /*choice*/ ctx[66] + "";
@@ -2798,7 +2846,7 @@ function create_each_block(ctx) {
2798
2846
  let dispose;
2799
2847
 
2800
2848
  function select_block_type(ctx, dirty) {
2801
- if (/*choices*/ ctx[62].props.length > 1) return create_if_block_5;
2849
+ if (/*choices*/ ctx[62].props.length > 1) return create_if_block_6;
2802
2850
  return create_else_block;
2803
2851
  }
2804
2852
 
@@ -2809,7 +2857,7 @@ function create_each_block(ctx) {
2809
2857
  return /*click_handler_3*/ ctx[36](/*selectedName*/ ctx[63]);
2810
2858
  }
2811
2859
 
2812
- const if_block_creators = [create_if_block_2, create_if_block_3, create_if_block_4];
2860
+ const if_block_creators = [create_if_block_2, create_if_block_3, create_if_block_5];
2813
2861
  const if_blocks = [];
2814
2862
 
2815
2863
  function select_block_type_1(ctx, dirty) {
@@ -2819,8 +2867,13 @@ function create_each_block(ctx) {
2819
2867
  return -1;
2820
2868
  }
2821
2869
 
2870
+ function select_block_ctx(ctx, index) {
2871
+ if (index === 1) return get_if_ctx(ctx);
2872
+ return ctx;
2873
+ }
2874
+
2822
2875
  if (~(current_block_type_index = select_block_type_1(ctx))) {
2823
- if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
2876
+ if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](select_block_ctx(ctx, current_block_type_index));
2824
2877
  }
2825
2878
 
2826
2879
  return {
@@ -2873,7 +2926,7 @@ function create_each_block(ctx) {
2873
2926
 
2874
2927
  if (current_block_type_index === previous_block_index) {
2875
2928
  if (~current_block_type_index) {
2876
- if_blocks[current_block_type_index].p(ctx, dirty);
2929
+ if_blocks[current_block_type_index].p(select_block_ctx(ctx, current_block_type_index), dirty);
2877
2930
  }
2878
2931
  } else {
2879
2932
  if (if_block1) {
@@ -2890,10 +2943,10 @@ function create_each_block(ctx) {
2890
2943
  if_block1 = if_blocks[current_block_type_index];
2891
2944
 
2892
2945
  if (!if_block1) {
2893
- if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
2946
+ if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](select_block_ctx(ctx, current_block_type_index));
2894
2947
  if_block1.c();
2895
2948
  } else {
2896
- if_block1.p(ctx, dirty);
2949
+ if_block1.p(select_block_ctx(ctx, current_block_type_index), dirty);
2897
2950
  }
2898
2951
 
2899
2952
  transition_in(if_block1, 1);
@@ -2926,7 +2979,7 @@ function create_each_block(ctx) {
2926
2979
  };
2927
2980
  }
2928
2981
 
2929
- // (462:8) {#if currentRule === 'inline' && bringableToFront[selectedElemIndex] !== null}
2982
+ // (466:8) {#if currentRule === 'inline' && bringableToFront[selectedElemIndex] !== null}
2930
2983
  function create_if_block_1(ctx) {
2931
2984
  let div;
2932
2985
  let mounted;
@@ -2985,7 +3038,7 @@ function create_fragment(ctx) {
2985
3038
  let current;
2986
3039
  let mounted;
2987
3040
  let dispose;
2988
- let if_block0 = /*targetsToSearch*/ ctx[1].length > 1 && create_if_block_7(ctx);
3041
+ let if_block0 = /*targetsToSearch*/ ctx[1].length > 1 && create_if_block_8(ctx);
2989
3042
  let each_value_4 = getRuleNames(/*allRules*/ ctx[2][/*selectedElemIndex*/ ctx[4]]);
2990
3043
  let each_blocks_1 = [];
2991
3044
 
@@ -3121,7 +3174,7 @@ function create_fragment(ctx) {
3121
3174
  if (if_block0) {
3122
3175
  if_block0.p(ctx, dirty);
3123
3176
  } else {
3124
- if_block0 = create_if_block_7(ctx);
3177
+ if_block0 = create_if_block_8(ctx);
3125
3178
  if_block0.c();
3126
3179
  if_block0.m(div4, t4);
3127
3180
  }