@wikicasa-dev/components 2.5.6-alpha.6 → 2.5.6-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import o from "../../packages/components/lib/UIKit/Card/BaseCard.vue.js";
2
- import '../../assets/BaseCard.css';/* empty css */
2
+ import '../../assets/CardRootPrimitive.css';/* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import o from "../../packages/components/lib/UIKit/Card/CardRootPrimitive.vue.js";
2
- import '../../assets/BaseCard.css';/* empty css */
2
+ import '../../assets/CardRootPrimitive.css';/* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
@@ -1,5 +1,5 @@
1
1
  export interface IntersectionObserverProviderProps {
2
- observeOnce?: boolean;
2
+ emitOnce?: boolean;
3
3
  skip?: boolean;
4
4
  threshold?: number;
5
5
  }
@@ -10,11 +10,9 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<In
10
10
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
11
11
  default?(_: {
12
12
  observer: IntersectionObserver | undefined;
13
- isVisible: boolean;
14
13
  }): any;
15
14
  default?(_: {
16
15
  observer: IntersectionObserver | undefined;
17
- isVisible: boolean;
18
16
  }): any;
19
17
  }>;
20
18
  export default _default;
@@ -1,8 +1,15 @@
1
+ type __VLS_Props = {
2
+ observeOnce?: boolean;
3
+ };
1
4
  declare function __VLS_template(): {
2
5
  attrs: Partial<{}>;
3
6
  slots: {
4
- default?(_: {}): any;
5
- default?(_: {}): any;
7
+ default?(_: {
8
+ isVisible: boolean;
9
+ }): any;
10
+ default?(_: {
11
+ isVisible: true;
12
+ }): any;
6
13
  };
7
14
  refs: {
8
15
  root: HTMLDivElement;
@@ -10,7 +17,7 @@ declare function __VLS_template(): {
10
17
  rootEl: any;
11
18
  };
12
19
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
- declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
20
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
14
21
  root: HTMLDivElement;
15
22
  }, any>;
16
23
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -1,4 +1,4 @@
1
1
  import { InjectionKey, ShallowRef } from 'vue';
2
- export declare const ObserverOnceKey: InjectionKey<boolean>;
3
- export declare const ObserverKey: InjectionKey<ShallowRef<IntersectionObserver | undefined>>;
4
- export declare const IsVisibleKey: InjectionKey<ShallowRef<boolean>>;
2
+ export declare const ObserveTargetKey: InjectionKey<(e: Element) => void>;
3
+ export declare const UnobserveTargetKey: InjectionKey<(e: Element) => void>;
4
+ export declare const VisibleTargetsKey: InjectionKey<ShallowRef<Set<string>>>;
@@ -1,6 +1,6 @@
1
1
  const e = /* @__PURE__ */ Symbol(), o = /* @__PURE__ */ Symbol(), s = /* @__PURE__ */ Symbol();
2
2
  export {
3
- s as IsVisibleKey,
4
- o as ObserverKey,
5
- e as ObserverOnceKey
3
+ e as ObserveTargetKey,
4
+ o as UnobserveTargetKey,
5
+ s as VisibleTargetsKey
6
6
  };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { default as P } from "./packages/components/lib/UIKit/Accordion/BaseAccordion.vue.js";
2
2
  import { default as S } from "./packages/components/lib/UIKit/Accordion/BaseAccordionItem.vue.js";
3
- import './assets/BaseCard.css';import './assets/SwiperSlideImagePrimitive.css';import './assets/SwiperPaginationPrimitive.css';import './assets/BaseSnackbar.css';import './assets/BaseModal.css';import './assets/BaseDropDown.css';import './assets/BaseBadge.css';import './assets/ClearableAutocomplete.css';import './assets/BaseAutocomplete.css';import './assets/BaseAlert.css';import './assets/AccessibleSelect.css';import './assets/RadioButtonItem.css';import './assets/BaseTabsIndicator.css';import './assets/BaseTabs.css';import './assets/CheckboxBtn.css';import './assets/BaseAccordionItem.css';/* empty css */
3
+ import './assets/CardRootPrimitive.css';import './assets/SwiperSlideImagePrimitive.css';import './assets/SwiperPaginationPrimitive.css';import './assets/BaseSnackbar.css';import './assets/BaseModal.css';import './assets/BaseDropDown.css';import './assets/BaseBadge.css';import './assets/ClearableAutocomplete.css';import './assets/BaseAutocomplete.css';import './assets/BaseAlert.css';import './assets/AccessibleSelect.css';import './assets/RadioButtonItem.css';import './assets/BaseTabsIndicator.css';import './assets/BaseTabs.css';import './assets/CheckboxBtn.css';import './assets/BaseAccordionItem.css';/* empty css */
4
4
  import { default as I } from "./packages/components/lib/UIKit/Accordion/AccordionItemPrimitive.vue.js";
5
5
  import { default as h } from "./packages/components/lib/UIKit/Accordion/AccordionHeaderPrimitive.vue.js";
6
6
  import { default as w } from "./packages/components/lib/UIKit/Accordion/AccordionTriggerPrimitive.vue.js";
@@ -1,46 +1,47 @@
1
- import { defineComponent as d, shallowRef as i, provide as t, onBeforeMount as m, onBeforeUnmount as O, createElementBlock as h, renderSlot as a, openBlock as y, normalizeClass as k } from "vue";
2
- import { ObserverOnceKey as B, ObserverKey as p, IsVisibleKey as V } from "../../../../../../components/IntersectionObserver/v2/types.js";
3
- const $ = /* @__PURE__ */ d({
1
+ import { defineComponent as b, shallowRef as i, provide as l, onBeforeMount as h, onBeforeUnmount as p, createElementBlock as g, renderSlot as c, openBlock as y, normalizeClass as O } from "vue";
2
+ import { VisibleTargetsKey as k, ObserveTargetKey as B, UnobserveTargetKey as w } from "../../../../../../components/IntersectionObserver/v2/types.js";
3
+ const I = /* @__PURE__ */ b({
4
4
  __name: "IntersectionObserverProvider",
5
5
  props: {
6
- observeOnce: { type: Boolean, default: !0 },
6
+ emitOnce: { type: Boolean, default: !0 },
7
7
  skip: { type: Boolean, default: !1 },
8
8
  threshold: { default: 0 }
9
9
  },
10
10
  emits: ["intersection"],
11
- setup(s, { emit: u }) {
12
- const v = u, o = i(!1), e = i(), c = (r) => {
13
- s.skip || r.forEach(({ target: n, isIntersecting: l }) => {
14
- o.value = l, l && (v("intersection"), s.observeOnce && f(n));
11
+ setup(r, { emit: u }) {
12
+ const v = u, o = i(/* @__PURE__ */ new Set()), t = i(), d = (e) => {
13
+ r.skip || e.forEach(({ target: a, isIntersecting: m }) => {
14
+ const s = a.getAttribute("target-id");
15
+ if (!s) return;
16
+ const n = new Set(o.value);
17
+ m ? (n.add(s), v("intersection")) : n.delete(s), o.value = n;
15
18
  });
16
- }, f = (r) => {
17
- e.value && e.value.unobserve(r);
18
- }, b = () => {
19
- e.value && e.value.disconnect();
19
+ }, f = () => {
20
+ t.value?.disconnect();
20
21
  };
21
- return t(B, s.observeOnce), t(p, e), t(V, o), m(() => {
22
- e.value = new IntersectionObserver(c, {
22
+ return l(k, o), l(B, (e) => {
23
+ t.value?.observe(e);
24
+ }), l(w, (e) => {
25
+ t.value?.unobserve(e);
26
+ }), h(() => {
27
+ t.value = new IntersectionObserver(d, {
23
28
  root: null,
24
29
  //if the root is null, then we will check if the target is visible in the doc root!
25
- threshold: s.threshold
30
+ threshold: r.threshold
26
31
  });
27
- }), O(() => {
28
- b();
29
- }), (r, n) => s.observeOnce ? a(r.$slots, "default", {
32
+ }), p(() => {
33
+ f();
34
+ }), (e, a) => r.emitOnce ? c(e.$slots, "default", {
30
35
  key: 1,
31
- observer: e.value,
32
- isVisible: o.value
33
- }) : (y(), h("div", {
36
+ observer: t.value
37
+ }) : (y(), g("div", {
34
38
  key: 0,
35
- class: k(r.$attrs["root-classes"])
39
+ class: O(e.$attrs["root-classes"])
36
40
  }, [
37
- a(r.$slots, "default", {
38
- observer: e.value,
39
- isVisible: o.value
40
- })
41
+ c(e.$slots, "default", { observer: t.value })
41
42
  ], 2));
42
43
  }
43
44
  });
44
45
  export {
45
- $ as default
46
+ I as default
46
47
  };
@@ -1,19 +1,29 @@
1
- import { defineComponent as i, useTemplateRef as c, inject as r, onMounted as u, createElementBlock as v, renderSlot as t, unref as n, openBlock as f, normalizeClass as d } from "vue";
2
- import { ObserverOnceKey as m, ObserverKey as p, IsVisibleKey as b } from "../../../../../../components/IntersectionObserver/v2/types.js";
3
- const K = /* @__PURE__ */ i({
1
+ import { defineComponent as v, useTemplateRef as c, useId as f, inject as o, computed as d, onMounted as b, watch as m, createElementBlock as g, renderSlot as n, openBlock as p, unref as T } from "vue";
2
+ import { VisibleTargetsKey as y, ObserveTargetKey as k, UnobserveTargetKey as O } from "../../../../../../components/IntersectionObserver/v2/types.js";
3
+ const _ = ["target-id"], K = /* @__PURE__ */ v({
4
4
  __name: "IntersectionObserverTarget",
5
- setup(y) {
6
- const e = c("root"), l = r(m, void 0), s = r(p, void 0), a = r(b, void 0);
7
- return u(() => {
8
- !s?.value || !e.value || s?.value.observe(e.value);
9
- }), (o, _) => !n(l) || !n(a) ? (f(), v("div", {
5
+ props: {
6
+ observeOnce: { type: Boolean, default: !0 }
7
+ },
8
+ setup(s) {
9
+ const e = c("root"), a = f(), i = o(y, void 0), l = o(k, void 0), u = o(O, void 0), t = d(
10
+ () => (e.value ? i?.value.has(a) : !1) || !1
11
+ );
12
+ return b(() => {
13
+ e.value && l?.(e.value);
14
+ }), m(t, (r) => {
15
+ s.observeOnce && r && e.value && u?.(e.value);
16
+ }), (r, h) => !s.observeOnce || !t.value ? (p(), g("div", {
10
17
  key: 0,
11
18
  ref_key: "root",
12
19
  ref: e,
13
- class: d(o.$attrs["root-classes"])
20
+ "target-id": T(a)
14
21
  }, [
15
- t(o.$slots, "default")
16
- ], 2)) : t(o.$slots, "default", { key: 1 });
22
+ n(r.$slots, "default", { isVisible: t.value })
23
+ ], 8, _)) : n(r.$slots, "default", {
24
+ key: 1,
25
+ isVisible: t.value
26
+ });
17
27
  }
18
28
  });
19
29
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.5.6-alpha.6",
3
+ "version": "2.5.6-alpha.8",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",