@depict-ai/utilishared 2.0.3 → 2.0.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.
package/latest/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { onCleanup as $qgKv4$onCleanup, createEffect as $qgKv4$createEffect, createSignal as $qgKv4$createSignal } from "solid-js";
2
- import { template as $qgKv4$template, insert as $qgKv4$insert, className as $qgKv4$className, setAttribute as $qgKv4$setAttribute, spread as $qgKv4$spread, mergeProps as $qgKv4$mergeProps, addEventListener as $qgKv4$addEventListener, delegateEvents as $qgKv4$delegateEvents, effect as $qgKv4$effect, style as $qgKv4$style, createComponent as $qgKv4$createComponent } from "solid-js/web";
2
+ import { template as $qgKv4$template, getNextElement as $qgKv4$getNextElement, insert as $qgKv4$insert, className as $qgKv4$className, setAttribute as $qgKv4$setAttribute, spread as $qgKv4$spread, mergeProps as $qgKv4$mergeProps, runHydrationEvents as $qgKv4$runHydrationEvents, addEventListener as $qgKv4$addEventListener, getNextMarker as $qgKv4$getNextMarker, delegateEvents as $qgKv4$delegateEvents, effect as $qgKv4$effect, style as $qgKv4$style, createComponent as $qgKv4$createComponent } from "solid-js/web";
3
3
  import { register_es_version } from "../multi_import_deduplicator.mjs";
4
4
  register_es_version("utilishared", "latest");
5
5
  function $parcel$export(e, n, v, s) {
@@ -13,7 +13,7 @@ function $parcel$export(e, n, v, s) {
13
13
  function $parcel$interopDefault(a) {
14
14
  return a && a.__esModule ? a.default : a;
15
15
  }
16
- const $0766c85d387a9765$export$83d89fbfd8236492 = "2.0.3";
16
+ const $0766c85d387a9765$export$83d89fbfd8236492 = "2.0.5";
17
17
  const $571bce04eb920cd8$export$55fe61489d2c7417 = /*@__PURE__*/(() => process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && (globalThis?.document?.currentScript?.dataset?.debug === "true" || globalThis?.localStorage?.getItem?.("debug") === "true"))();
18
18
  const $649f456f663da9fc$var$browser_prefix_styling = "color: #fff;";
19
19
  let $649f456f663da9fc$var$browser_prefix = "[Depict]";
@@ -3742,11 +3742,11 @@ const $ef9394fafebd5eab$var$_tmpl$ = /*#__PURE__*/$qgKv4$template(`<div class="d
3742
3742
  $ef9394fafebd5eab$var$_tmpl$4 = /*#__PURE__*/$qgKv4$template(`<button aria-label="Scroll right"class="right d-navbutton"type=button>`);
3743
3743
  class $ef9394fafebd5eab$export$692b27c28639e5b9 {
3744
3744
  // this is just here because it's often needed together with the slider
3745
- container = $ef9394fafebd5eab$var$_tmpl$();
3745
+ container = $qgKv4$getNextElement($ef9394fafebd5eab$var$_tmpl$);
3746
3746
  #elements = {
3747
- sliding_el_: $ef9394fafebd5eab$var$_tmpl$2(),
3748
- left_: $ef9394fafebd5eab$var$_tmpl$3(),
3749
- right_: $ef9394fafebd5eab$var$_tmpl$4()
3747
+ sliding_el_: $qgKv4$getNextElement($ef9394fafebd5eab$var$_tmpl$2),
3748
+ left_: $qgKv4$getNextElement($ef9394fafebd5eab$var$_tmpl$3),
3749
+ right_: $qgKv4$getNextElement($ef9394fafebd5eab$var$_tmpl$4)
3750
3750
  };
3751
3751
  insert_here = this.#elements.sliding_el_;
3752
3752
  intersecting_items_object = {};
@@ -4855,7 +4855,7 @@ function $d352a8202024de5c$var$setup_load_more(t, root, chunk_size, view_more_te
4855
4855
  } = t,
4856
4856
  load_more_cont = $0bdb8dbcf1bc7f34$export$d3e2a0560cbf4787(`<div class="load-more-container"></div>`),
4857
4857
  load_button = load_more_cont.appendChild((() => {
4858
- const _el$ = $d352a8202024de5c$var$_tmpl$();
4858
+ const _el$ = $qgKv4$getNextElement($d352a8202024de5c$var$_tmpl$);
4859
4859
  $qgKv4$insert(_el$, view_more_text);
4860
4860
  return _el$;
4861
4861
  })());
@@ -5006,8 +5006,8 @@ const $63cbb5de51d11596$export$ffb0004e005737fa = ({
5006
5006
  };
5007
5007
  const $ca66c9553e84df02$var$_tmpl$ = /*#__PURE__*/$qgKv4$template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 320 512"><desc>Right arrow</desc><path d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z">`),
5008
5008
  $ca66c9553e84df02$var$_tmpl$2 = /*#__PURE__*/$qgKv4$template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 320 512"><desc>Left arrow</desc><path d="M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z">`);
5009
- const $ca66c9553e84df02$export$dc84183312f0c201 = /*@__PURE__*/(() => $ca66c9553e84df02$var$_tmpl$())();
5010
- const $ca66c9553e84df02$export$6038895ac52bd044 = /*@__PURE__*/(() => $ca66c9553e84df02$var$_tmpl$2())();
5009
+ const $ca66c9553e84df02$export$dc84183312f0c201 = /*@__PURE__*/(() => $qgKv4$getNextElement($ca66c9553e84df02$var$_tmpl$))();
5010
+ const $ca66c9553e84df02$export$6038895ac52bd044 = /*@__PURE__*/(() => $qgKv4$getNextElement($ca66c9553e84df02$var$_tmpl$2))();
5011
5011
  const $9a744f57ab06c32e$export$68c017fd93791405 = ({
5012
5012
  duration = 500
5013
5013
  } = {
@@ -5065,7 +5065,7 @@ async function $30e801eaa3dc319e$export$c84671f46d6a1ca({
5065
5065
  ipns: ipns
5066
5066
  } = rows_or_empty_object;
5067
5067
  const is_static = !ipns && !button;
5068
- const our_style_el = $30e801eaa3dc319e$var$_tmpl$();
5068
+ const our_style_el = $qgKv4$getNextElement($30e801eaa3dc319e$var$_tmpl$);
5069
5069
  const container_class = $460df8550f9d084d$export$a6db784f019668ba();
5070
5070
  const selector_beginning = `.depict .${container_class}>`;
5071
5071
  const el_count_ipns = $607fc90221d440a6$export$e806c6c1615a59ae();
@@ -5103,7 +5103,7 @@ async function $30e801eaa3dc319e$export$c84671f46d6a1ca({
5103
5103
  if (button) {
5104
5104
  button_class = $460df8550f9d084d$export$a6db784f019668ba();
5105
5105
  const button_container = (() => {
5106
- const _el$2 = $30e801eaa3dc319e$var$_tmpl$2();
5106
+ const _el$2 = $qgKv4$getNextElement($30e801eaa3dc319e$var$_tmpl$2);
5107
5107
  $qgKv4$className(_el$2, "load-more-container " + button_class);
5108
5108
  $qgKv4$insert(_el$2, () => $b9b0dba897847b2a$export$f63fcc839cb0f734("click", () => ipns(ipns.state + (rows_or_empty_object.rows_per_click ?? 1)), button));
5109
5109
  return _el$2;
@@ -5405,7 +5405,7 @@ function $d31b48b85102c1ec$export$80039a49055269fb() {
5405
5405
  }
5406
5406
  const $a75adf1478c4522f$var$_tmpl$ = /*#__PURE__*/$qgKv4$template(`<img src=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJkaXNwbGF5OiBpbmxpbmUtYmxvY2s7IHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7IiB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgOCAxNSI+PHBhdGggc3R5bGU9ImZpbGw6IHJnYigwLCAwLCAwKTsiIGQ9Ik0uNjI5LjAwMWMuMTUuMDA4LjI5My4wNzIuMzk4LjE4bDYuNzkyIDYuODlhLjYwMS42MDEgMCAwIDEgMCAuODZsLTYuNzkyIDYuODg4YS41ODYuNTg2IDAgMCAxLS44NDYgMCAuNjAxLjYwMSAwIDAgMSAwLS44Nkw2LjU1NCA3LjUuMjExIDEuMDAxYS42MDEuNjAxIDAgMCAxIDAtLjg2Yy4xMTUtLjEuMjY2LS4xNS40MTgtLjE0Ij48L3BhdGg+PC9zdmc+>`);
5407
5407
  function $a75adf1478c4522f$export$af88b4929c2dc86() {
5408
- const img = $a75adf1478c4522f$var$_tmpl$();
5408
+ const img = $qgKv4$getNextElement($a75adf1478c4522f$var$_tmpl$);
5409
5409
  return {
5410
5410
  left: [img],
5411
5411
  right: [img.cloneNode()]
@@ -5500,7 +5500,7 @@ function $2436f68ea927d4a8$export$1d17a045bcc711b1({
5500
5500
  }
5501
5501
  function $2436f68ea927d4a8$export$a09282b33e69b43f(unique_name) {
5502
5502
  return (() => {
5503
- const _el$ = $2436f68ea927d4a8$var$_tmpl$(),
5503
+ const _el$ = $qgKv4$getNextElement($2436f68ea927d4a8$var$_tmpl$),
5504
5504
  _el$2 = _el$.firstChild;
5505
5505
  $qgKv4$setAttribute(_el$2, "name", `radio-${unique_name}`);
5506
5506
  return _el$;
@@ -5677,8 +5677,8 @@ const $f78bc6a06402a6cf$var$_tmpl$ = /*#__PURE__*/$qgKv4$template(`<div class=de
5677
5677
  $f78bc6a06402a6cf$var$_tmpl$2 = /*#__PURE__*/$qgKv4$template(`<div class=depict_slider_scroll_container>`);
5678
5678
  function $f78bc6a06402a6cf$export$93223e488e7ee078(options) {
5679
5679
  function constructor_plugin(_slider_options) {
5680
- const scroll_bar = $f78bc6a06402a6cf$var$_tmpl$();
5681
- const scroll_container = $f78bc6a06402a6cf$var$_tmpl$2();
5680
+ const scroll_bar = $qgKv4$getNextElement($f78bc6a06402a6cf$var$_tmpl$);
5681
+ const scroll_container = $qgKv4$getNextElement($f78bc6a06402a6cf$var$_tmpl$2);
5682
5682
  if (options.scroll_bar_classes?.length) scroll_bar.classList.add(...options.scroll_bar_classes);
5683
5683
  if (options.scroll_container_classes?.length) scroll_container.classList.add(...options.scroll_container_classes);
5684
5684
  // Default styles always present
@@ -5735,7 +5735,7 @@ function $06fe260f91efff62$export$b36d2489a5a16728(_t, {
5735
5735
  }
5736
5736
  async function $06fe260f91efff62$export$49b950309ab787ad() {
5737
5737
  if ("scrollBehavior" in document.documentElement.style) return true;
5738
- const test_div = $06fe260f91efff62$var$_tmpl$();
5738
+ const test_div = $qgKv4$getNextElement($06fe260f91efff62$var$_tmpl$);
5739
5739
  const body = await (0, $0b48ba2f40ce6067$export$b6ae1bc530f4c149).wait_for_element("body");
5740
5740
  body.append(test_div);
5741
5741
  test_div.scrollLeft = 1;
@@ -7241,11 +7241,12 @@ function $769ce417b39aa7d3$export$4a3043e508dd72f0({
7241
7241
  ...attributes
7242
7242
  }) {
7243
7243
  const button = (() => {
7244
- const _el$ = $769ce417b39aa7d3$var$_tmpl$();
7244
+ const _el$ = $qgKv4$getNextElement($769ce417b39aa7d3$var$_tmpl$);
7245
7245
  $qgKv4$spread(_el$, $qgKv4$mergeProps(attributes, {
7246
7246
  "type": "button"
7247
7247
  }), false, true);
7248
7248
  $qgKv4$insert(_el$, children);
7249
+ $qgKv4$runHydrationEvents();
7249
7250
  return _el$;
7250
7251
  })();
7251
7252
  button.classList.add("show-more");
@@ -7253,7 +7254,7 @@ function $769ce417b39aa7d3$export$4a3043e508dd72f0({
7253
7254
  }
7254
7255
  const $cf7ca80454d7b4c0$var$_tmpl$ = /*#__PURE__*/$qgKv4$template(`<div class=slidein-backdrop>`),
7255
7256
  $cf7ca80454d7b4c0$var$_tmpl$2 = /*#__PURE__*/$qgKv4$template(`<div class=slidein><div class=header><span class=title></span><button class=close></button></div><div class=body>`),
7256
- $cf7ca80454d7b4c0$var$_tmpl$3 = /*#__PURE__*/$qgKv4$template(`<div class=depict>`);
7257
+ $cf7ca80454d7b4c0$var$_tmpl$3 = /*#__PURE__*/$qgKv4$template(`<div class=depict><!$><!/><!$><!/>`);
7257
7258
  async function $cf7ca80454d7b4c0$export$8a0e4d6f6abf7e90({
7258
7259
  title_: title_,
7259
7260
  children: children,
@@ -7264,14 +7265,15 @@ async function $cf7ca80454d7b4c0$export$8a0e4d6f6abf7e90({
7264
7265
  const open_promise = new Promise(r => close_ = r);
7265
7266
  const body = await (0, $0b48ba2f40ce6067$export$b6ae1bc530f4c149).wait_for_element("body");
7266
7267
  const backdrop = (() => {
7267
- const _el$ = $cf7ca80454d7b4c0$var$_tmpl$();
7268
+ const _el$ = $qgKv4$getNextElement($cf7ca80454d7b4c0$var$_tmpl$);
7268
7269
  $qgKv4$addEventListener(_el$, "click", close_, true);
7270
+ $qgKv4$runHydrationEvents();
7269
7271
  return _el$;
7270
7272
  })();
7271
7273
  const [exit_title_iterator, exitable_title_iterator] = $b8270fcf290bb3af$export$927664b47117acb0(title_);
7272
7274
  const closing_handlers = [exit_title_iterator];
7273
7275
  const slidein = (() => {
7274
- const _el$2 = $cf7ca80454d7b4c0$var$_tmpl$2(),
7276
+ const _el$2 = $qgKv4$getNextElement($cf7ca80454d7b4c0$var$_tmpl$2),
7275
7277
  _el$3 = _el$2.firstChild,
7276
7278
  _el$4 = _el$3.firstChild,
7277
7279
  _el$5 = _el$4.nextSibling,
@@ -7280,12 +7282,17 @@ async function $cf7ca80454d7b4c0$export$8a0e4d6f6abf7e90({
7280
7282
  $qgKv4$addEventListener(_el$5, "click", close_, true);
7281
7283
  $qgKv4$insert(_el$5, CloseIcon);
7282
7284
  $qgKv4$insert(_el$6, children);
7285
+ $qgKv4$runHydrationEvents();
7283
7286
  return _el$2;
7284
7287
  })();
7285
7288
  const elements_in_container = (() => {
7286
- const _el$7 = $cf7ca80454d7b4c0$var$_tmpl$3();
7287
- $qgKv4$insert(_el$7, backdrop, null);
7288
- $qgKv4$insert(_el$7, slidein, null);
7289
+ const _el$7 = $qgKv4$getNextElement($cf7ca80454d7b4c0$var$_tmpl$3),
7290
+ _el$8 = _el$7.firstChild,
7291
+ [_el$9, _co$] = $qgKv4$getNextMarker(_el$8.nextSibling),
7292
+ _el$10 = _el$9.nextSibling,
7293
+ [_el$11, _co$2] = $qgKv4$getNextMarker(_el$10.nextSibling);
7294
+ $qgKv4$insert(_el$7, backdrop, _el$9, _co$);
7295
+ $qgKv4$insert(_el$7, slidein, _el$11, _co$2);
7289
7296
  return _el$7;
7290
7297
  })();
7291
7298
  body.append(elements_in_container);
@@ -7337,7 +7344,7 @@ async function $cf7ca80454d7b4c0$export$8a0e4d6f6abf7e90({
7337
7344
  }
7338
7345
  $qgKv4$delegateEvents(["click"]);
7339
7346
  const $72d170fd5c7cb3fe$var$_tmpl$ = /*#__PURE__*/$qgKv4$template(`<div class=option-list>`),
7340
- $72d170fd5c7cb3fe$var$_tmpl$2 = /*#__PURE__*/$qgKv4$template(`<button type=button><span class=size>`),
7347
+ $72d170fd5c7cb3fe$var$_tmpl$2 = /*#__PURE__*/$qgKv4$template(`<button type=button><span class=size></span><!$><!/>`),
7341
7348
  $72d170fd5c7cb3fe$var$_tmpl$3 = /*#__PURE__*/$qgKv4$template(`<span class=sold-out>`);
7342
7349
  async function $72d170fd5c7cb3fe$export$c068ad5361be7646({
7343
7350
  title_: title_,
@@ -7355,15 +7362,17 @@ async function $72d170fd5c7cb3fe$export$c068ad5361be7646({
7355
7362
  CloseIcon: CloseIcon,
7356
7363
  title_: title_,
7357
7364
  children: [(() => {
7358
- const _el$ = $72d170fd5c7cb3fe$var$_tmpl$();
7365
+ const _el$ = $qgKv4$getNextElement($72d170fd5c7cb3fe$var$_tmpl$);
7359
7366
  $qgKv4$insert(_el$, () => items_.map(({
7360
7367
  size_name_: size_name_,
7361
7368
  is_available_: is_available_,
7362
7369
  id_: id_
7363
7370
  }) => {
7364
7371
  const button = (() => {
7365
- const _el$2 = $72d170fd5c7cb3fe$var$_tmpl$2(),
7366
- _el$3 = _el$2.firstChild;
7372
+ const _el$2 = $qgKv4$getNextElement($72d170fd5c7cb3fe$var$_tmpl$2),
7373
+ _el$3 = _el$2.firstChild,
7374
+ _el$4 = _el$3.nextSibling,
7375
+ [_el$5, _co$] = $qgKv4$getNextMarker(_el$4.nextSibling);
7367
7376
  _el$2.$$click = () => {
7368
7377
  size_selected(id_);
7369
7378
  close_();
@@ -7371,10 +7380,11 @@ async function $72d170fd5c7cb3fe$export$c068ad5361be7646({
7371
7380
  $qgKv4$className(_el$2, "option" + (is_available_ ? " available" : ""));
7372
7381
  $qgKv4$insert(_el$3, size_name_);
7373
7382
  $qgKv4$insert(_el$2, !is_available_ && (() => {
7374
- const _el$4 = $72d170fd5c7cb3fe$var$_tmpl$3();
7375
- $qgKv4$insert(_el$4, () => $8c97019b5f7b0d0e$export$7c081fdbc65b6a2a(exitable_oos_iterator));
7376
- return _el$4;
7377
- })(), null);
7383
+ const _el$6 = $qgKv4$getNextElement($72d170fd5c7cb3fe$var$_tmpl$3);
7384
+ $qgKv4$insert(_el$6, () => $8c97019b5f7b0d0e$export$7c081fdbc65b6a2a(exitable_oos_iterator));
7385
+ return _el$6;
7386
+ })(), _el$5, _co$);
7387
+ $qgKv4$runHydrationEvents();
7378
7388
  return _el$2;
7379
7389
  })();
7380
7390
  if (!is_available_) button.disabled = true;
@@ -7405,10 +7415,11 @@ const $ad592d9ddbcffe72$export$84712d0562a614b8 = ({
7405
7415
  $ad592d9ddbcffe72$var$inserted = true;
7406
7416
  }
7407
7417
  return (() => {
7408
- const _el$ = $ad592d9ddbcffe72$var$_tmpl$();
7418
+ const _el$ = $qgKv4$getNextElement($ad592d9ddbcffe72$var$_tmpl$);
7409
7419
  $qgKv4$className(_el$, `depict-placeholder${extra_classes ? " " + extra_classes : ""}`);
7410
7420
  $qgKv4$spread(_el$, attributes, false, false);
7411
7421
  $qgKv4$effect(_$p => $qgKv4$style(_el$, style ? style : `width:${width};height:${height};`, _$p));
7422
+ $qgKv4$runHydrationEvents();
7412
7423
  return _el$;
7413
7424
  })();
7414
7425
  };
@@ -7420,22 +7431,24 @@ const $ad592d9ddbcffe72$export$d613f5b6d0a331a8 = ({
7420
7431
  style: `position:relative;width:100%;padding-bottom:${1 / aspect_ratio * 100}%`
7421
7432
  }, attributes));
7422
7433
  };
7423
- const $fbe64cf2cf408e4f$var$_tmpl$ = /*#__PURE__*/$qgKv4$template(`<div class="depict recommendation_container"><div class=grid>`),
7434
+ const $fbe64cf2cf408e4f$var$_tmpl$ = /*#__PURE__*/$qgKv4$template(`<div class="depict recommendation_container"><!$><!/><div class=grid>`),
7424
7435
  $fbe64cf2cf408e4f$var$_tmpl$2 = /*#__PURE__*/$qgKv4$template(`<h4 class=recs_header>`);
7425
7436
  const $fbe64cf2cf408e4f$export$97f31f44c68c1d5 = (title, surface_classes = []) => $b9b0dba897847b2a$export$eb0b9ed911409b57(e => e.classList.add(...surface_classes), (() => {
7426
- const _el$ = $fbe64cf2cf408e4f$var$_tmpl$(),
7427
- _el$2 = _el$.firstChild;
7437
+ const _el$ = $qgKv4$getNextElement($fbe64cf2cf408e4f$var$_tmpl$),
7438
+ _el$3 = _el$.firstChild,
7439
+ [_el$4, _co$] = $qgKv4$getNextMarker(_el$3.nextSibling),
7440
+ _el$2 = _el$4.nextSibling;
7428
7441
  $qgKv4$insert(_el$, title && typeof title === "string" ? (() => {
7429
- const _el$3 = $fbe64cf2cf408e4f$var$_tmpl$2();
7430
- $qgKv4$insert(_el$3, title);
7431
- return _el$3;
7432
- })() : title, _el$2);
7442
+ const _el$5 = $qgKv4$getNextElement($fbe64cf2cf408e4f$var$_tmpl$2);
7443
+ $qgKv4$insert(_el$5, title);
7444
+ return _el$5;
7445
+ })() : title, _el$4, _co$);
7433
7446
  return _el$;
7434
7447
  })());
7435
7448
  const $7693290d077384da$var$_tmpl$ = /*#__PURE__*/$qgKv4$template(`<svg viewBox="0 0 320 512"><desc>Right arrow</desc><path d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z">`),
7436
7449
  $7693290d077384da$var$_tmpl$2 = /*#__PURE__*/$qgKv4$template(`<svg viewBox="0 0 320 512"><desc>Left arrow</desc><path d="M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z">`);
7437
- const $7693290d077384da$export$32a55d57d151bc5a = () => $7693290d077384da$var$_tmpl$();
7438
- const $7693290d077384da$export$ddd70fdae1b350e6 = () => $7693290d077384da$var$_tmpl$2();
7450
+ const $7693290d077384da$export$32a55d57d151bc5a = () => $qgKv4$getNextElement($7693290d077384da$var$_tmpl$);
7451
+ const $7693290d077384da$export$ddd70fdae1b350e6 = () => $qgKv4$getNextElement($7693290d077384da$var$_tmpl$2);
7439
7452
  const $6f1582c15e13f2f0$var$_tmpl$ = /*#__PURE__*/$qgKv4$template(`<button class=color-circle-container><div class=outer-circle><div class=inner-circle>`),
7440
7453
  $6f1582c15e13f2f0$var$_tmpl$2 = /*#__PURE__*/$qgKv4$template(`<div class=color-picker role=form aria-label="Color picker">`);
7441
7454
  /**
@@ -7448,7 +7461,7 @@ function $6f1582c15e13f2f0$var$ColorCircle({
7448
7461
  onHoverUpdate: onHoverUpdate
7449
7462
  }) {
7450
7463
  const button = (() => {
7451
- const _el$ = $6f1582c15e13f2f0$var$_tmpl$(),
7464
+ const _el$ = $qgKv4$getNextElement($6f1582c15e13f2f0$var$_tmpl$),
7452
7465
  _el$2 = _el$.firstChild,
7453
7466
  _el$3 = _el$2.firstChild;
7454
7467
  _el$.$$click = e => onClick(e.currentTarget, color);
@@ -7465,6 +7478,7 @@ function $6f1582c15e13f2f0$var$ColorCircle({
7465
7478
  _v$2: undefined,
7466
7479
  _v$3: undefined
7467
7480
  });
7481
+ $qgKv4$runHydrationEvents();
7468
7482
  return _el$;
7469
7483
  })();
7470
7484
  button.addEventListener("mouseenter", $b04e44fad5ea42c7$export$b3bbfd758f11cfa9(() => onHoverUpdate(button, color, true)));
@@ -7533,7 +7547,7 @@ function $6f1582c15e13f2f0$export$590326cc34f49e2d({
7533
7547
  if (initial_index > -1) setActiveIndex(initial_index);
7534
7548
  if (onlyCircles) return circles;
7535
7549
  return (() => {
7536
- const _el$4 = $6f1582c15e13f2f0$var$_tmpl$2();
7550
+ const _el$4 = $qgKv4$getNextElement($6f1582c15e13f2f0$var$_tmpl$2);
7537
7551
  $qgKv4$insert(_el$4, circles);
7538
7552
  return _el$4;
7539
7553
  })();
@@ -7567,12 +7581,12 @@ const $7f57d546b5d5b3d6$export$237455ad7e59d4e5 = ({
7567
7581
  }) => {
7568
7582
  if (Array.isArray(children) && children.length === 1) children = children[0];
7569
7583
  innerRef = (() => {
7570
- const _el$ = $7f57d546b5d5b3d6$var$_tmpl$();
7584
+ const _el$ = $qgKv4$getNextElement($7f57d546b5d5b3d6$var$_tmpl$);
7571
7585
  $qgKv4$insert(_el$, children);
7572
7586
  return _el$;
7573
7587
  })();
7574
7588
  outerRef = (() => {
7575
- const _el$2 = $7f57d546b5d5b3d6$var$_tmpl$2();
7589
+ const _el$2 = $qgKv4$getNextElement($7f57d546b5d5b3d6$var$_tmpl$2);
7576
7590
  $qgKv4$insert(_el$2, innerRef);
7577
7591
  return _el$2;
7578
7592
  })();
@@ -7707,8 +7721,9 @@ function $45af9e834781a9bc$export$a62825542f1bfcf5({
7707
7721
  $649f456f663da9fc$export$de56f1198d121036(image_options, () => {}); // noop function is to allow to get here quickly by "jump to function definition"
7708
7722
  $7547e32486a3abc0$export$8048b892d651b310(new Error("no image src provided: " + src));
7709
7723
  return (() => {
7710
- const _el$ = $45af9e834781a9bc$var$_tmpl$();
7724
+ const _el$ = $qgKv4$getNextElement($45af9e834781a9bc$var$_tmpl$);
7711
7725
  $qgKv4$spread(_el$, image_options, false, false);
7726
+ $qgKv4$runHydrationEvents();
7712
7727
  return _el$;
7713
7728
  })(); // we don't want everything to fail if someone misused this component
7714
7729
  }
@@ -7720,13 +7735,14 @@ function $45af9e834781a9bc$export$a62825542f1bfcf5({
7720
7735
  const format = formats[i];
7721
7736
  const srcset = $45af9e834781a9bc$var$make_srcset(src, format, resolutions);
7722
7737
  sources.push((() => {
7723
- const _el$2 = $45af9e834781a9bc$var$_tmpl$2();
7738
+ const _el$2 = $qgKv4$getNextElement($45af9e834781a9bc$var$_tmpl$2);
7724
7739
  $qgKv4$setAttribute(_el$2, "type", `image/${format}`);
7725
7740
  $qgKv4$spread(_el$2, set_dataset ? {
7726
7741
  "data-srcset": srcset
7727
7742
  } : {
7728
7743
  srcset: srcset
7729
7744
  }, false, false);
7745
+ $qgKv4$runHydrationEvents();
7730
7746
  return _el$2;
7731
7747
  })());
7732
7748
  }
@@ -7736,8 +7752,9 @@ function $45af9e834781a9bc$export$a62825542f1bfcf5({
7736
7752
  delete opts_without_src["src"];
7737
7753
  delete opts_without_src["srcset"];
7738
7754
  const the_image = (() => {
7739
- const _el$3 = $45af9e834781a9bc$var$_tmpl$();
7755
+ const _el$3 = $qgKv4$getNextElement($45af9e834781a9bc$var$_tmpl$);
7740
7756
  $qgKv4$spread(_el$3, opts_without_src, false, false);
7757
+ $qgKv4$runHydrationEvents();
7741
7758
  return _el$3;
7742
7759
  })(); // create image
7743
7760
  sources.push(the_image); // chrome seems to be the dumbest piece of cake that has ever existed and just load the first source?????
@@ -7747,7 +7764,7 @@ function $45af9e834781a9bc$export$a62825542f1bfcf5({
7747
7764
  for (let i = 0; i < sources.length; i++) sizes_setter_(sources[i]).catch((0, $7547e32486a3abc0$export$8048b892d651b310));
7748
7765
  // embed all sources into a <picture> so that the browser understands they're "together"
7749
7766
  const picture = (() => {
7750
- const _el$4 = $45af9e834781a9bc$var$_tmpl$3();
7767
+ const _el$4 = $qgKv4$getNextElement($45af9e834781a9bc$var$_tmpl$3);
7751
7768
  $qgKv4$insert(_el$4, sources);
7752
7769
  return _el$4;
7753
7770
  })();
@@ -7781,7 +7798,7 @@ function $45af9e834781a9bc$var$optimized_img_url_generator(format, url, width) {
7781
7798
  }
7782
7799
  const $914971fb43986a16$var$_tmpl$ = /*#__PURE__*/$qgKv4$template(`<div>`),
7783
7800
  $914971fb43986a16$var$_tmpl$2 = /*#__PURE__*/$qgKv4$template(`<canvas class=depict-img-filler height=3000>`),
7784
- $914971fb43986a16$var$_tmpl$3 = /*#__PURE__*/$qgKv4$template(`<div style=position:relative><div class=depict-img-cont>`);
7801
+ $914971fb43986a16$var$_tmpl$3 = /*#__PURE__*/$qgKv4$template(`<div style=position:relative><div class=depict-img-cont></div><!$><!/>`);
7785
7802
  const $914971fb43986a16$var$rendering_options_to_sourceset_component = /*@__PURE__*/new WeakMap();
7786
7803
  // Add nolazy to placeholders to avoid errors with the stupid lazyfier
7787
7804
  const $914971fb43986a16$var$add_nolazy_to_placeholder = type => type === "placeholder" ? "nolazy" : "";
@@ -7811,7 +7828,7 @@ function $914971fb43986a16$var$Image({
7811
7828
  ...image_options
7812
7829
  }) {
7813
7830
  const div = (() => {
7814
- const _el$ = $914971fb43986a16$var$_tmpl$();
7831
+ const _el$ = $qgKv4$getNextElement($914971fb43986a16$var$_tmpl$);
7815
7832
  $qgKv4$effect(_$p => $qgKv4$style(_el$, `position:relative;width:100%;padding-bottom:${1 / aspect_ratio * 100}%`, _$p));
7816
7833
  return _el$;
7817
7834
  })();
@@ -7837,15 +7854,17 @@ function $914971fb43986a16$var$CompatibleImage({
7837
7854
  ...image_options
7838
7855
  }) {
7839
7856
  const canvas = (() => {
7840
- const _el$2 = $914971fb43986a16$var$_tmpl$2();
7857
+ const _el$2 = $qgKv4$getNextElement($914971fb43986a16$var$_tmpl$2);
7841
7858
  $qgKv4$setAttribute(_el$2, "width", 3000 * aspect_ratio);
7842
7859
  return _el$2;
7843
7860
  })();
7844
7861
  const sourceset_component = $914971fb43986a16$var$srcset_comp_from_map_or_new(rendering_options, srcset_opts, canvas);
7845
7862
  const IMG_tag = image_options.src?.startsWith("data:") || !sourceset_component ? "img" : sourceset_component;
7846
7863
  return (() => {
7847
- const _el$3 = $914971fb43986a16$var$_tmpl$3(),
7848
- _el$4 = _el$3.firstChild;
7864
+ const _el$3 = $qgKv4$getNextElement($914971fb43986a16$var$_tmpl$3),
7865
+ _el$4 = _el$3.firstChild,
7866
+ _el$5 = _el$4.nextSibling,
7867
+ [_el$6, _co$] = $qgKv4$getNextMarker(_el$5.nextSibling);
7849
7868
  $qgKv4$insert(_el$4, $qgKv4$createComponent(IMG_tag, $qgKv4$mergeProps({
7850
7869
  alt: alt
7851
7870
  }, remove_on_error ? {
@@ -7855,7 +7874,7 @@ function $914971fb43986a16$var$CompatibleImage({
7855
7874
  return $b9b0dba897847b2a$export$22a65337c1b43b1f(["depict-img-comp", image_options.class, $914971fb43986a16$var$add_nolazy_to_placeholder(rendering_options?.type)]);
7856
7875
  }
7857
7876
  })));
7858
- $qgKv4$insert(_el$3, canvas, null);
7877
+ $qgKv4$insert(_el$3, canvas, _el$6, _co$);
7859
7878
  return _el$3;
7860
7879
  })();
7861
7880
  }
@@ -7876,7 +7895,7 @@ function $914971fb43986a16$var$srcset_comp_from_map_or_new(rendering_options, sr
7876
7895
  }
7877
7896
  var $504e2aac6aea7baf$exports = {};
7878
7897
  $504e2aac6aea7baf$exports = ".depict .images-container {\n position: relative;\n}\n\n.depict .second-image-container {\n width: 100%;\n opacity: 0;\n position: absolute;\n top: 0;\n}\n\n.depict .hovering .main-image-container {\n opacity: 0;\n}\n\n.depict .hovering .second-image-container {\n opacity: 1;\n}\n\n";
7879
- const $8483d1d9fcee52ec$var$_tmpl$ = /*#__PURE__*/$qgKv4$template(`<div class=images-container><div class=main-image-container>`),
7898
+ const $8483d1d9fcee52ec$var$_tmpl$ = /*#__PURE__*/$qgKv4$template(`<div class=images-container><!$><!/><div class=main-image-container>`),
7880
7899
  $8483d1d9fcee52ec$var$_tmpl$2 = /*#__PURE__*/$qgKv4$template(`<div class=second-image-container>`);
7881
7900
  // Saving bytez
7882
7901
  // Maybe? @Daniel
@@ -8018,13 +8037,15 @@ const $8483d1d9fcee52ec$export$2369f6fc1c911576 = ({
8018
8037
  });
8019
8038
  const no_second_img = !second_src && !second_srcset && !second_srcset_opts;
8020
8039
  const images_container = (() => {
8021
- const _el$ = $8483d1d9fcee52ec$var$_tmpl$(),
8022
- _el$2 = _el$.firstChild;
8040
+ const _el$ = $qgKv4$getNextElement($8483d1d9fcee52ec$var$_tmpl$),
8041
+ _el$3 = _el$.firstChild,
8042
+ [_el$4, _co$] = $qgKv4$getNextMarker(_el$3.nextSibling),
8043
+ _el$2 = _el$4.nextSibling;
8023
8044
  $qgKv4$insert(_el$, !no_second_img && (() => {
8024
- const _el$3 = $8483d1d9fcee52ec$var$_tmpl$2();
8025
- $qgKv4$insert(_el$3, second_image);
8026
- return _el$3;
8027
- })(), _el$2);
8045
+ const _el$5 = $qgKv4$getNextElement($8483d1d9fcee52ec$var$_tmpl$2);
8046
+ $qgKv4$insert(_el$5, second_image);
8047
+ return _el$5;
8048
+ })(), _el$4, _co$);
8028
8049
  $qgKv4$insert(_el$2, main_image);
8029
8050
  return _el$;
8030
8051
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/utilishared",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
6
  "types": "ES10/index.d.ts",
@@ -11,12 +11,13 @@
11
11
  },
12
12
  "scripts": {
13
13
  "build": "./scripts/build",
14
- "publish": "yarn build && yarn npm publish",
14
+ "publish": "yarn build && yarn npm publish --tag dev",
15
15
  "print-included-package-files": "yarn pack --dry-run",
16
16
  "typecheck": "yarn g:tsc --build tsconfig.json",
17
17
  "test": "jest"
18
18
  },
19
19
  "targets": {
20
+ "types": {},
20
21
  "module_latest": {
21
22
  "outputFormat": "esmodule",
22
23
  "isLibrary": true,
@@ -52,28 +53,87 @@
52
53
  "browsers": "supports array-flat"
53
54
  },
54
55
  "optimize": false
56
+ },
57
+ "module_latest_server": {
58
+ "outputFormat": "esmodule",
59
+ "isLibrary": true,
60
+ "context": "node",
61
+ "distDir": "dist/server/esmodule_latest",
62
+ "engines": {
63
+ "browsers": "last 1 chrome version"
64
+ },
65
+ "optimize": false
66
+ },
67
+ "main_latest_server": {
68
+ "outputFormat": "commonjs",
69
+ "isLibrary": true,
70
+ "context": "node",
71
+ "distDir": "dist/server/commonjs_latest",
72
+ "engines": {
73
+ "browsers": "last 1 chrome version"
74
+ },
75
+ "optimize": false
76
+ },
77
+ "module_es10_server": {
78
+ "outputFormat": "esmodule",
79
+ "isLibrary": true,
80
+ "context": "node",
81
+ "distDir": "dist/server/esmodule_ES10",
82
+ "engines": {
83
+ "browsers": "supports array-flat"
84
+ },
85
+ "optimize": false
86
+ },
87
+ "main_es10_server": {
88
+ "outputFormat": "commonjs",
89
+ "isLibrary": true,
90
+ "context": "node",
91
+ "distDir": "dist/server/commonjs_ES10",
92
+ "engines": {
93
+ "browsers": "supports array-flat"
94
+ },
95
+ "optimize": false
55
96
  }
56
97
  },
57
98
  "exports": {
58
99
  ".": {
59
100
  "types": "./ES10/index.d.ts",
60
- "import": "./ES10/index.js",
61
- "require": "./ES10/index.cjs"
101
+ "browser": {
102
+ "import": "./ES10/index.js",
103
+ "require": "./ES10/index.cjs"
104
+ },
105
+ "node": {
106
+ "import": "./server/ES10/index.js",
107
+ "require": "./server/ES10/index.cjs"
108
+ }
62
109
  },
63
110
  "./latest": {
64
111
  "types": "./latest/index.d.ts",
65
- "import": "./latest/index.js",
66
- "require": "./latest/index.cjs"
112
+ "browser": {
113
+ "import": "./latest/index.js",
114
+ "require": "./latest/index.cjs"
115
+ },
116
+ "node": {
117
+ "import": "./server/latest/index.js",
118
+ "require": "./server/latest/index.cjs"
119
+ }
67
120
  },
68
121
  "./ES10": {
69
122
  "types": "./ES10/index.d.ts",
70
- "import": "./ES10/index.js",
71
- "require": "./ES10/index.cjs"
123
+ "browser": {
124
+ "import": "./ES10/index.js",
125
+ "require": "./ES10/index.cjs"
126
+ },
127
+ "node": {
128
+ "import": "./server/ES10/index.js",
129
+ "require": "./server/ES10/index.cjs"
130
+ }
72
131
  }
73
132
  },
74
133
  "files": [
75
134
  "/latest",
76
135
  "/ES10",
136
+ "/server",
77
137
  "./multi_import_deduplicator.mjs",
78
138
  "./multi_import_deduplicator.cjs"
79
139
  ],