mosaic 2.0.0 → 2.2.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.
package/README.md CHANGED
@@ -31,11 +31,11 @@ const controller = Mosaic(root, {
31
31
  increment: (state, amount: number) => ({ ...state, count: state.count + amount }),
32
32
  reset: (state) => ({ ...state, count: 0 }),
33
33
  },
34
- elements: [
35
- { select: "[data-increment]", on: { click: ({ dispatch }) => dispatch("increment", 1) } },
36
- { select: "[data-reset]", on: { click: "reset" } },
37
- { select: "output", text: ({ state }) => state.count },
38
- ],
34
+ elements: {
35
+ "[data-increment]": { on: { click: ({ dispatch }) => dispatch("increment", 1) } },
36
+ "[data-reset]": { on: { click: "reset" } },
37
+ output: { text: ({ state }) => state.count },
38
+ },
39
39
  });
40
40
 
41
41
  await controller.dispatch("increment", 2);
@@ -45,8 +45,8 @@ console.log(controller.getState().count); // 2, with the DOM updated
45
45
  controller.destroy();
46
46
  ```
47
47
 
48
- `$` is an alias of `Mosaic`. A minified ESM entry is available at
49
- `mosaic/dist/mosaic.min.js`, including for use through an ESM-compatible CDN.
48
+ <!-- `$` is an alias of `Mosaic`. A minified ESM entry is available at
49
+ `mosaic/dist/mosaic.min.js`, including for use through an ESM-compatible CDN. -->
50
50
 
51
51
  ## Configuration and selectors
52
52
 
@@ -55,10 +55,15 @@ are optional. Reducers receive `(state, payload)`, run synchronously, and return
55
55
  complete next state. State and action payload types are inferred from the config;
56
56
  annotate payload parameters in TypeScript.
57
57
 
58
- Each binding's `select` is an ordinary CSS selector. It binds **all matching
58
+ `elements` is an object whose keys are ordinary CSS selectors and whose values
59
+ describe the bindings. It is optional; an empty object is also valid. Each selector binds **all matching
59
60
  descendants** of the root, excluding the root itself. Use `:scope > button` for
60
61
  direct children. Empty match sets are valid. Invalid CSS selectors throw at mount.
61
62
 
63
+ Only own enumerable string keys are processed, in JavaScript `Object.entries()`
64
+ order (declaration order for ordinary CSS selector keys). Computed keys work too:
65
+ `elements: { [selector]: { text: ({ state }) => state.label } }`.
66
+
62
67
  Matches are captured once, in document order. Later insertions, reordering, and
63
68
  selector changes do not alter that collection or its indexes. Create the required
64
69
  nodes before mounting. Destroy and remount an enhancement when its binding
@@ -68,6 +73,25 @@ An optional configuration callback, `getState(state)`, transforms the complete
68
73
  state at initialization and after each write. It must be synchronous and return
69
74
  the complete state. Read current state through the controller's `getState()`.
70
75
 
76
+ ### Migrating from array bindings
77
+
78
+ Move each binding's `select` value to an object key and remove `select`:
79
+
80
+ ```ts
81
+ // Before
82
+ elements: [{ select: "output", text: ({ state }) => state.count }]
83
+
84
+ // After
85
+ elements: { output: { text: ({ state }) => state.count } }
86
+ ```
87
+
88
+ The array format is no longer supported and throws a `TypeError`, including for
89
+ empty arrays. Each selector key has one binding. Consolidate repeated selectors
90
+ into one binding, composing callbacks when necessary. Distinct selectors may still
91
+ match the same element and are processed independently in object-entry order.
92
+ When composing maps with object spread, later entries for the same selector
93
+ replace the entire earlier binding; handlers and rendering callbacks are not merged.
94
+
71
95
  ## Rendering
72
96
 
73
97
  Rendering callbacks receive `{ state, element, index }`. `element` is the bound
@@ -78,18 +102,20 @@ element and `index` is its position in the captured collection for that binding.
78
102
  | `attribute` | Map of exact DOM attribute names to values | Sets or removes the returned attributes |
79
103
  | `text` | String, number, boolean, `null`, or `undefined` | Writes plain text content |
80
104
  | `class` | Map of class names to booleans | Toggles only returned class names |
105
+ | `property` | Map of DOM property names to arbitrary JavaScript values | Assigns the returned properties directly |
81
106
 
82
107
  ```ts
83
- {
84
- select: "button",
85
- attribute: ({ state }) => ({
86
- "aria-expanded": String(state.open),
87
- "data-status": state.status,
88
- disabled: state.busy,
89
- tabindex: 0,
90
- }),
91
- text: ({ state }) => state.label,
92
- class: ({ state }) => ({ active: state.open }),
108
+ elements: {
109
+ button: {
110
+ attribute: ({ state }) => ({
111
+ "aria-expanded": String(state.open),
112
+ "data-status": state.status,
113
+ tabindex: 0,
114
+ }),
115
+ text: ({ state }) => state.label,
116
+ class: ({ state }) => ({ active: state.open }),
117
+ property: ({ state }) => ({ disabled: state.busy }),
118
+ },
93
119
  }
94
120
  ```
95
121
 
@@ -106,6 +132,28 @@ including child elements. It writes text rather than parsing HTML.
106
132
  also remain untouched; return `false` explicitly to remove a class. Nullish class
107
133
  or attribute maps leave the element unchanged.
108
134
 
135
+ `property` writes DOM properties, not HTML attributes. For example,
136
+ `property: ({ state }) => ({ value: state.query })` updates an input's live `.value`.
137
+ It is strictly one-way: state supplies the initial and subsequent rendered values;
138
+ DOM edits and input/change events do not update state. A later render restores the
139
+ state-derived values.
140
+
141
+ Nullish property maps do nothing, and omitted properties remain untouched.
142
+ Explicit entries, including `null` and `undefined`, are assigned directly. Mosaic
143
+ does not normalise, validate, or coerce property values. Native or custom property
144
+ setters may coerce values, reflect attributes, or have other side effects. An
145
+ assignment is skipped only when `Object.is` compares the live property value and
146
+ the requested value as equal.
147
+
148
+ For each matched element, rendering proceeds in this order:
149
+ `attribute` → `text` → `class` → `property` → `sync`, regardless of configuration
150
+ field order. Bindings targeting the same property can overwrite one another;
151
+ for example, `property` and `sync` do not independently own `.value`. `sync` keeps
152
+ its existing behaviour, including composition handling, and has the final write
153
+ when it updates a managed property. Property ownership and avoiding conflicting
154
+ writes remain application responsibilities; Mosaic does not detect or resolve
155
+ conflicts.
156
+
109
157
  ## Events
110
158
 
111
159
  `on` maps DOM event names to callbacks or action names. Event callbacks receive
@@ -121,7 +169,7 @@ const config = {
121
169
  actions: {
122
170
  choose: (state: { selected: number }, { index }: { index: number }) => ({ ...state, selected: index }),
123
171
  },
124
- elements: [{ select: "button", on: { click: "choose" } }],
172
+ elements: { button: { on: { click: "choose" } } },
125
173
  };
126
174
  ```
127
175
 
@@ -148,10 +196,10 @@ from user input requires no action or event handler:
148
196
  ```ts
149
197
  const controller = Mosaic(root, {
150
198
  state: { query: "", enabled: false },
151
- elements: [
152
- { select: "input.search", sync: "query" },
153
- { select: 'input[type="checkbox"]', sync: "enabled" },
154
- ],
199
+ elements: {
200
+ "input.search": { sync: "query" },
201
+ 'input[type="checkbox"]': { sync: "enabled" },
202
+ },
155
203
  });
156
204
  ```
157
205
 
@@ -163,7 +211,7 @@ inputs, and multi-selects cause a mount error.
163
211
 
164
212
  At mount, the DOM wins over configured state. When controls share a key, the first
165
213
  bound control supplies its initial value and the rest mirror it. Binding order
166
- follows the `elements` array, then document order within each binding. Keys with
214
+ follows the `elements` object's entry order, then document order within each binding. Keys with
167
215
  no matching controls retain their configured state. Multiple checkboxes sharing a
168
216
  key mirror one boolean; they do not collect an array of selected values. Mixing
169
217
  checkbox and string-value controls on the same key causes a mount error.
@@ -177,10 +225,11 @@ Add `on.input` only when you want additional behaviour, such as filtering
177
225
  suggestions. The handler sees state that `sync` has already updated:
178
226
 
179
227
  ```ts
180
- {
181
- select: "input.search",
182
- sync: "query",
183
- on: { input: ({ dispatch }) => dispatch("filterSuggestions") },
228
+ elements: {
229
+ "input.search": {
230
+ sync: "query",
231
+ on: { input: ({ dispatch }) => dispatch("filterSuggestions") },
232
+ },
184
233
  }
185
234
  ```
186
235
 
package/dist/mosaic.js CHANGED
@@ -21,13 +21,23 @@ function writeClasses(node, classes) {
21
21
  node.classList.toggle(name, enabled);
22
22
  }
23
23
  }
24
+ function writeProperties(node, properties) {
25
+ const target = node;
26
+ for (const [name, value] of Object.entries(properties ?? {})) {
27
+ if (!Object.is(target[name], value))
28
+ target[name] = value;
29
+ }
30
+ }
24
31
 
25
32
  function initialise(rootNode, config, store) {
26
33
  const { controller } = store;
27
34
  let state = config.state ?? {};
28
- const elements = (config.elements ?? []).map((binding) => ({
35
+ if (Array.isArray(config.elements)) {
36
+ throw new TypeError("elements must be a selector-keyed object, not an array; move each select property to an object key");
37
+ }
38
+ const elements = Object.entries(config.elements ?? {}).map(([selector, binding]) => ({
29
39
  ...binding,
30
- targets: [...rootNode.querySelectorAll(binding.select)],
40
+ targets: [...rootNode.querySelectorAll(selector)],
31
41
  }));
32
42
  function listen(target, type, callback) {
33
43
  target.addEventListener(type, callback);
@@ -111,7 +121,7 @@ function initialise(rootNode, config, store) {
111
121
  });
112
122
  }
113
123
  store.initialise(state, (state) => {
114
- for (const { targets, attribute, text, class: classes, sync } of elements) {
124
+ for (const { targets, attribute, text, class: classes, property, sync } of elements) {
115
125
  for (const [index, target] of targets.entries()) {
116
126
  if (store.isDestroyed())
117
127
  return;
@@ -133,6 +143,12 @@ function initialise(rootNode, config, store) {
133
143
  return;
134
144
  writeClasses(target, value);
135
145
  }
146
+ if (property) {
147
+ const value = property({ state, element: target, index });
148
+ if (store.isDestroyed())
149
+ return;
150
+ writeProperties(target, value);
151
+ }
136
152
  if (sync !== undefined && !composing.has(target)) {
137
153
  controls.get(target).write(state[sync]);
138
154
  }
@@ -1 +1 @@
1
- function t(t,e){for(const[n,r]of Object.entries(e??{}))if(!1===r||null==r)t.hasAttribute(n)&&t.removeAttribute(n);else{const e=!0===r?"":String(r);t.getAttribute(n)!==e&&t.setAttribute(n,e)}}function e(t,e){const n=null==e?"":String(e);t.textContent!==n&&(t.textContent=n)}function n(t,e){for(const[n,r]of Object.entries(e??{}))t.classList.toggle(n,r)}function r(t){const e=t.localName,n=t;if("http://www.w3.org/1999/xhtml"===t.namespaceURI){if("input"===e&&"checkbox"===n.type)return{kind:"boolean",read:()=>n.checked,write:t=>{n.checked!==t&&(n.checked=t)}};if("textarea"===e||"select"===e&&!t.multiple||"input"===e&&!["radio","file"].includes(n.type)){const e=t;return{kind:"string",read:()=>e.value,write:t=>{e.value!==t&&(e.value=t)}}}}throw new TypeError("sync requires a checkbox, string-valued input, textarea, or single-select control")}function o({actions:t={},getState:e=t=>t}){let n,r,o=null,s=[],c=[],i=!1;const a=[],l=()=>new DOMException("Mosaic has been destroyed","AbortError"),u=(()=>{const t=new Set;return{clear(){t.clear()},subscribe(e){const n={callback:e};return t.add(n),()=>{t.delete(n)}},publish(...e){const n=[];for(const r of[...t])if(t.has(r))try{r.callback(...e)}catch(t){n.push(t)}return n}}})();function f(t){n=e({...t})}function d(){return{...n}}function h(){i||null!==o||(o=requestAnimationFrame(p))}function p(){if(o=null,i)return;const t=s;s=[],c=t;const e=d(),n=[];try{r(e)}catch(t){n.push(t)}if(i||n.push(...u.publish(e)),c=[],!i)if(n.length){const e=1===n.length?n[0]:new AggregateError(n,"Errors while publishing a state update");t.forEach(({reject:t})=>t(e)),0===t.length&&reportError(e)}else t.forEach(({resolve:t})=>t())}return{controller:{dispatch:(e,...n)=>{try{if(i)throw l();if(!Object.hasOwn(t,e))throw new Error(`Unknown action "${e}"`);if("function"!=typeof t[e])throw new TypeError(`Action "${e}" is not a function`);const r=t[e].call(t,d(),n[0]);if(i)throw l();return f(r),new Promise((t,e)=>{s.push({resolve:t,reject:e}),h()})}catch(t){return Promise.reject(t)}},getState:d,subscribe:t=>i?()=>{}:u.subscribe(t),destroy(){if(i)return;i=!0,null!==o&&cancelAnimationFrame(o),o=null;const t=l();[...c,...s].forEach(({reject:e})=>e(t)),c=[],s=[],u.clear(),a.splice(0).forEach(t=>t()),r=()=>{}}},own:t=>{a.push(t)},isDestroyed:()=>i,initialise:(t,e)=>{f(t),r=e,r(d())},patch:t=>{i||(f({...d(),...t}),h())}}}const s=(s,c)=>{const i=o({...c});try{!function(o,s,c){const{controller:i}=c;let a=s.state??{};const l=(s.elements??[]).map(t=>({...t,targets:[...o.querySelectorAll(t.select)]}));function u(t,e,n){t.addEventListener(e,n),c.own(()=>t.removeEventListener(e,n))}function f(t){t&&t.catch(t=>{c.isDestroyed()&&t instanceof DOMException&&"AbortError"===t.name||reportError(t)})}const d=new Map,h=new WeakMap,p=new WeakSet;for(const t of l){const{sync:e}=t;if(void 0!==e)for(const n of t.targets){const t=r(n);h.set(n,t);const o=d.get(e);if(void 0!==o&&o!==t.kind)throw new TypeError(`sync key "${e}" cannot mix checkbox and string controls`);void 0===o&&(a={...a,[e]:t.read()},d.set(e,t.kind));const s=()=>{const n=t.read();i.getState()[e]!==n&&c.patch({[e]:n})};"boolean"===t.kind?(u(n,"input",s),u(n,"change",s)):(u(n,"compositionstart",()=>{p.add(n)}),u(n,"input",t=>{t.isComposing&&p.add(n),s()}),u(n,"compositionend",()=>{p.delete(n),s()}))}}for(const t of l)t.targets.forEach((e,n)=>{for(const[r,o]of Object.entries(t.on??{}))o&&u(e,r,t=>{if(c.isDestroyed())return;const r={state:i.getState(),element:e,index:n,event:t,dispatch:i.dispatch,getState:i.getState};f("string"==typeof o?(0,i.dispatch)(o,r):o(r))})});c.initialise(a,r=>{for(const{targets:o,attribute:s,text:i,class:a,sync:u}of l)for(const[l,f]of o.entries()){if(c.isDestroyed())return;if(s){const e=s({state:r,element:f,index:l});if(c.isDestroyed())return;t(f,e)}if(i){const t=i({state:r,element:f,index:l});if(c.isDestroyed())return;e(f,t)}if(a){const t=a({state:r,element:f,index:l});if(c.isDestroyed())return;n(f,t)}void 0===u||p.has(f)||h.get(f).write(r[u])}})}(s,c,i)}catch(t){throw i.controller.destroy(),t}return i.controller},c=s;export{c as $,s as Mosaic};
1
+ function t(t,e){for(const[n,r]of Object.entries(e??{}))if(!1===r||null==r)t.hasAttribute(n)&&t.removeAttribute(n);else{const e=!0===r?"":String(r);t.getAttribute(n)!==e&&t.setAttribute(n,e)}}function e(t,e){const n=null==e?"":String(e);t.textContent!==n&&(t.textContent=n)}function n(t,e){for(const[n,r]of Object.entries(e??{}))t.classList.toggle(n,r)}function r(t,e){const n=t;for(const[t,r]of Object.entries(e??{}))Object.is(n[t],r)||(n[t]=r)}function o(t){const e=t.localName,n=t;if("http://www.w3.org/1999/xhtml"===t.namespaceURI){if("input"===e&&"checkbox"===n.type)return{kind:"boolean",read:()=>n.checked,write:t=>{n.checked!==t&&(n.checked=t)}};if("textarea"===e||"select"===e&&!t.multiple||"input"===e&&!["radio","file"].includes(n.type)){const e=t;return{kind:"string",read:()=>e.value,write:t=>{e.value!==t&&(e.value=t)}}}}throw new TypeError("sync requires a checkbox, string-valued input, textarea, or single-select control")}function s({actions:t={},getState:e=t=>t}){let n,r,o=null,s=[],c=[],i=!1;const a=[],l=()=>new DOMException("Mosaic has been destroyed","AbortError"),u=(()=>{const t=new Set;return{clear(){t.clear()},subscribe(e){const n={callback:e};return t.add(n),()=>{t.delete(n)}},publish(...e){const n=[];for(const r of[...t])if(t.has(r))try{r.callback(...e)}catch(t){n.push(t)}return n}}})();function f(t){n=e({...t})}function d(){return{...n}}function h(){i||null!==o||(o=requestAnimationFrame(p))}function p(){if(o=null,i)return;const t=s;s=[],c=t;const e=d(),n=[];try{r(e)}catch(t){n.push(t)}if(i||n.push(...u.publish(e)),c=[],!i)if(n.length){const e=1===n.length?n[0]:new AggregateError(n,"Errors while publishing a state update");t.forEach(({reject:t})=>t(e)),0===t.length&&reportError(e)}else t.forEach(({resolve:t})=>t())}return{controller:{dispatch:(e,...n)=>{try{if(i)throw l();if(!Object.hasOwn(t,e))throw new Error(`Unknown action "${e}"`);if("function"!=typeof t[e])throw new TypeError(`Action "${e}" is not a function`);const r=t[e].call(t,d(),n[0]);if(i)throw l();return f(r),new Promise((t,e)=>{s.push({resolve:t,reject:e}),h()})}catch(t){return Promise.reject(t)}},getState:d,subscribe:t=>i?()=>{}:u.subscribe(t),destroy(){if(i)return;i=!0,null!==o&&cancelAnimationFrame(o),o=null;const t=l();[...c,...s].forEach(({reject:e})=>e(t)),c=[],s=[],u.clear(),a.splice(0).forEach(t=>t()),r=()=>{}}},own:t=>{a.push(t)},isDestroyed:()=>i,initialise:(t,e)=>{f(t),r=e,r(d())},patch:t=>{i||(f({...d(),...t}),h())}}}const c=(c,i)=>{const a=s({...i});try{!function(s,c,i){const{controller:a}=i;let l=c.state??{};if(Array.isArray(c.elements))throw new TypeError("elements must be a selector-keyed object, not an array; move each select property to an object key");const u=Object.entries(c.elements??{}).map(([t,e])=>({...e,targets:[...s.querySelectorAll(t)]}));function f(t,e,n){t.addEventListener(e,n),i.own(()=>t.removeEventListener(e,n))}function d(t){t&&t.catch(t=>{i.isDestroyed()&&t instanceof DOMException&&"AbortError"===t.name||reportError(t)})}const h=new Map,p=new WeakMap,y=new WeakSet;for(const t of u){const{sync:e}=t;if(void 0!==e)for(const n of t.targets){const t=o(n);p.set(n,t);const r=h.get(e);if(void 0!==r&&r!==t.kind)throw new TypeError(`sync key "${e}" cannot mix checkbox and string controls`);void 0===r&&(l={...l,[e]:t.read()},h.set(e,t.kind));const s=()=>{const n=t.read();a.getState()[e]!==n&&i.patch({[e]:n})};"boolean"===t.kind?(f(n,"input",s),f(n,"change",s)):(f(n,"compositionstart",()=>{y.add(n)}),f(n,"input",t=>{t.isComposing&&y.add(n),s()}),f(n,"compositionend",()=>{y.delete(n),s()}))}}for(const t of u)t.targets.forEach((e,n)=>{for(const[r,o]of Object.entries(t.on??{}))o&&f(e,r,t=>{if(i.isDestroyed())return;const r={state:a.getState(),element:e,index:n,event:t,dispatch:a.dispatch,getState:a.getState};d("string"==typeof o?(0,a.dispatch)(o,r):o(r))})});i.initialise(l,o=>{for(const{targets:s,attribute:c,text:a,class:l,property:f,sync:d}of u)for(const[u,h]of s.entries()){if(i.isDestroyed())return;if(c){const e=c({state:o,element:h,index:u});if(i.isDestroyed())return;t(h,e)}if(a){const t=a({state:o,element:h,index:u});if(i.isDestroyed())return;e(h,t)}if(l){const t=l({state:o,element:h,index:u});if(i.isDestroyed())return;n(h,t)}if(f){const t=f({state:o,element:h,index:u});if(i.isDestroyed())return;r(h,t)}void 0===d||y.has(h)||p.get(h).write(o[d])}})}(c,i,a)}catch(t){throw a.controller.destroy(),t}return a.controller},i=c;export{i as $,c as Mosaic};
@@ -1,4 +1,4 @@
1
1
  import type { ActionHandlers, Controller, MosaicConfig } from "./types.js";
2
- export type { ActionHandlers, RenderContext, EventContext, Attributes, AttributeValue, Classes, TextValue, Controller, Dispatch, ElementConfig, EventBindings, MosaicConfig, StoreConfig, StringKey, SyncKey, } from "./types.js";
2
+ export type { ActionHandlers, RenderContext, EventContext, Attributes, AttributeValue, Classes, Properties, TextValue, Controller, Dispatch, ElementConfig, EventBindings, MosaicConfig, StoreConfig, StringKey, SyncKey, } from "./types.js";
3
3
  export declare const Mosaic: <State extends object = Record<string, never>, Actions extends ActionHandlers<State> = {}>(rootNode: Element, config: MosaicConfig<State, Actions>) => Controller<State, Actions>;
4
4
  export declare const $: typeof Mosaic;
@@ -11,6 +11,7 @@ export type AttributeValue = string | number | boolean | null | undefined;
11
11
  export type Attributes = Record<string, AttributeValue>;
12
12
  export type TextValue = string | number | boolean | null | undefined;
13
13
  export type Classes = Record<string, boolean>;
14
+ export type Properties = Record<string, unknown>;
14
15
  export type StringKey<State> = {
15
16
  [Key in keyof State]-?: State[Key] extends string ? Key : never;
16
17
  }[keyof State] & string;
@@ -35,10 +36,10 @@ export type EventBindings<State extends object, Actions> = {
35
36
  [Name in keyof Events]?: (keyof Actions & string) | ((context: EventContext<State, Actions, Events[Name]>) => void | Promise<void>);
36
37
  };
37
38
  export interface ElementConfig<State extends object, Actions = {}> {
38
- select: string;
39
39
  attribute?: (context: RenderContext<State>) => Attributes | null | undefined;
40
40
  text?: (context: RenderContext<State>) => TextValue;
41
41
  class?: (context: RenderContext<State>) => Classes | null | undefined;
42
+ property?: (context: RenderContext<State>) => Properties | null | undefined;
42
43
  on?: EventBindings<State, Actions>;
43
44
  sync?: SyncKey<State>;
44
45
  }
@@ -48,6 +49,6 @@ export interface StoreConfig<State extends object, Actions extends ActionHandler
48
49
  }
49
50
  export interface MosaicConfig<State extends object, Actions extends ActionHandlers<State> = {}> extends StoreConfig<State, Actions> {
50
51
  state?: State;
51
- elements?: ElementConfig<State, Actions>[];
52
+ elements?: Record<string, ElementConfig<State, Actions>>;
52
53
  }
53
54
  export {};
@@ -1,4 +1,5 @@
1
- import type { Attributes, Classes, TextValue } from "./types.js";
1
+ import type { Attributes, Classes, Properties, TextValue } from "./types.js";
2
2
  export declare function write(node: Element, attributes: Attributes | null | undefined): void;
3
3
  export declare function writeText(node: Element, value: TextValue): void;
4
4
  export declare function writeClasses(node: Element, classes: Classes | null | undefined): void;
5
+ export declare function writeProperties(node: Element, properties: Properties | null | undefined): void;
package/package.json CHANGED
@@ -1,13 +1,21 @@
1
1
  {
2
2
  "name": "mosaic",
3
3
  "type": "module",
4
- "version": "2.0.0",
4
+ "version": "2.2.0",
5
5
  "description": "A JavaScript library for progressive enhancing HTML",
6
6
  "main": "dist/mosaic.js",
7
7
  "browser": "dist/mosaic.js",
8
8
  "unpkg": "dist/mosaic.min.js",
9
9
  "module": "dist/mosaic.js",
10
10
  "types": "dist/types/index.d.ts",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/defx/mosaic.git"
14
+ },
15
+ "homepage": "https://github.com/defx/mosaic#readme",
16
+ "bugs": {
17
+ "url": "https://github.com/defx/mosaic/issues"
18
+ },
11
19
  "scripts": {
12
20
  "dev": "vite",
13
21
  "typecheck": "tsc --noEmit",