@oscarpalmer/abydon 0.16.0 → 0.19.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.
Files changed (54) hide show
  1. package/dist/{abydon.full.js → abydon.full.mjs} +542 -234
  2. package/dist/constants.d.mts +37 -0
  3. package/dist/constants.mjs +44 -0
  4. package/dist/fragment-9qTBAvtR.d.mts +82 -0
  5. package/dist/fragment.d.mts +2 -0
  6. package/dist/{fragment.js → fragment.mjs} +35 -6
  7. package/dist/fragments.d.mts +16 -0
  8. package/dist/{fragments.js → fragments.mjs} +11 -6
  9. package/dist/helpers/dom.d.mts +7 -0
  10. package/dist/helpers/{dom.js → dom.mjs} +7 -2
  11. package/dist/helpers/index.d.mts +10 -0
  12. package/dist/helpers/{index.js → index.mjs} +5 -6
  13. package/dist/index.d.mts +21 -0
  14. package/dist/index.mjs +24 -0
  15. package/dist/models.d.mts +2 -0
  16. package/dist/models.mjs +1 -0
  17. package/dist/node/attribute/index.d.mts +6 -0
  18. package/dist/node/attribute/{index.js → index.mjs} +11 -4
  19. package/dist/node/attribute/value.d.mts +6 -0
  20. package/dist/node/attribute/{value.js → value.mjs} +13 -10
  21. package/dist/node/event.d.mts +4 -0
  22. package/dist/node/{event.js → event.mjs} +5 -3
  23. package/dist/node/index.d.mts +6 -0
  24. package/dist/node/{index.js → index.mjs} +9 -7
  25. package/dist/node/value.d.mts +7 -0
  26. package/dist/node/{value.js → value.mjs} +9 -6
  27. package/dist/parse.d.mts +6 -0
  28. package/dist/{parse.js → parse.mjs} +3 -1
  29. package/package.json +42 -41
  30. package/src/constants.ts +38 -4
  31. package/src/fragment.ts +2 -2
  32. package/src/fragments.ts +10 -4
  33. package/src/helpers/dom.ts +10 -0
  34. package/src/helpers/index.ts +13 -10
  35. package/src/node/attribute/index.ts +11 -1
  36. package/src/node/attribute/value.ts +18 -10
  37. package/src/node/event.ts +9 -4
  38. package/src/node/value.ts +3 -2
  39. package/dist/constants.js +0 -25
  40. package/dist/index.js +0 -11
  41. package/dist/models.js +0 -0
  42. package/types/constants.d.ts +0 -17
  43. package/types/fragment.d.ts +0 -38
  44. package/types/fragments.d.ts +0 -13
  45. package/types/helpers/dom.d.ts +0 -3
  46. package/types/helpers/index.d.ts +0 -5
  47. package/types/index.d.ts +0 -20
  48. package/types/models.d.ts +0 -41
  49. package/types/node/attribute/index.d.ts +0 -2
  50. package/types/node/attribute/value.d.ts +0 -2
  51. package/types/node/event.d.ts +0 -1
  52. package/types/node/index.d.ts +0 -2
  53. package/types/node/value.d.ts +0 -3
  54. package/types/parse.d.ts +0 -2
package/types/index.d.ts DELETED
@@ -1,20 +0,0 @@
1
- import '@oscarpalmer/mora';
2
- import type { ReactiveArray } from '@oscarpalmer/mora';
3
- import { Fragment } from './fragment';
4
- import { Fragments } from './fragments';
5
- /**
6
- * Create Fragments from a reactive array
7
- * @param array Reactive array
8
- * @param identify Function to identify item
9
- * @param fragment Function to create fragment from item
10
- * @returns Fragments
11
- */
12
- export declare function fragments<Item>(array: ReactiveArray<Item>, identify: (item: Item) => unknown, fragment: (item: Item) => Fragment): Fragments;
13
- /**
14
- * Create Fragment from a template
15
- * @returns Fragment
16
- */
17
- export declare function html(template: TemplateStringsArray, ...values: unknown[]): Fragment;
18
- export * from '@oscarpalmer/mora';
19
- export type { Fragment } from './fragment';
20
- export type { Fragments } from './fragments';
package/types/models.d.ts DELETED
@@ -1,41 +0,0 @@
1
- import type { Reactive, ReactiveArray, Unsubscribe } from '@oscarpalmer/mora';
2
- import type { Fragment } from './fragment';
3
- export type FragmentConfiguration = {
4
- /**
5
- * Should the template be cached? _(defaults to `true`)_
6
- */
7
- cache?: boolean;
8
- /**
9
- * Identifier for the fragment
10
- *
11
- * _(An identifier can be used to uniquely identify a fragment,
12
- * which helps prevent re-rendering in certain scenarios)_
13
- */
14
- identifier?: unknown;
15
- };
16
- export type FragmentData = {
17
- expressions: unknown[];
18
- items: FragmentItem[];
19
- mora: MoraData;
20
- strings: TemplateStringsArray;
21
- template?: string;
22
- values: unknown[];
23
- };
24
- export type FragmentItem = {
25
- fragments?: Fragment[];
26
- nodes?: ChildNode[];
27
- text?: Text;
28
- };
29
- export type FragmentsState = {
30
- array: ReactiveArray<unknown>;
31
- fragment: (item: unknown) => Fragment;
32
- identify: (item: unknown) => unknown;
33
- instances: Record<string, Fragment>;
34
- mapped: ReactiveArray<Fragment>;
35
- subscriber: Unsubscribe | undefined;
36
- };
37
- type MoraData = {
38
- subscribers: Set<() => void>;
39
- values: Set<Reactive<unknown>>;
40
- };
41
- export {};
@@ -1,2 +0,0 @@
1
- import type { FragmentData } from '../../models';
2
- export declare function mapAttributes(data: FragmentData, element: HTMLElement | SVGElement): void;
@@ -1,2 +0,0 @@
1
- import type { FragmentData } from '../../models';
2
- export declare function setAttribute(data: FragmentData, element: HTMLElement | SVGElement, name: string, value: unknown): void;
@@ -1 +0,0 @@
1
- export declare function mapEvent(element: HTMLElement | SVGElement, name: string, value: unknown): void;
@@ -1,2 +0,0 @@
1
- import type { FragmentData } from '../models';
2
- export declare function mapNodes(data: FragmentData, nodes: ChildNode[]): void;
@@ -1,3 +0,0 @@
1
- import type { Reactive } from '@oscarpalmer/mora';
2
- import type { FragmentData } from '../models';
3
- export declare function setReactiveValue(data: FragmentData, comment: Comment, reactive: Reactive<unknown>): void;
package/types/parse.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import type { FragmentData } from './models';
2
- export declare function parse(data: FragmentData): string;