ember-primitives 0.30.0 → 0.30.1

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.
@@ -6,7 +6,6 @@ import { precompileTemplate } from '@ember/template-compilation';
6
6
  import { setComponentTemplate } from '@ember/component';
7
7
 
8
8
  class Scroller extends Component {
9
- withinElement;
10
9
  ref = modifier(el => {
11
10
  this.withinElement = el;
12
11
  });
@@ -1 +1 @@
1
- {"version":3,"file":"scroller.js","sources":["../../src/components/scroller.gts"],"sourcesContent":["import Component from \"@glimmer/component\";\nimport { isDestroyed, isDestroying } from \"@ember/destroyable\";\nimport { hash } from \"@ember/helper\";\n\nimport { modifier } from \"ember-modifier\";\n\n/**\n * Utility component for helping with scrolling in any direction within\n * any of the 4 directions: up, down, left, right.\n *\n * This can be used to auto-scroll content as new content is inserted into the scrollable area, or possibly to bring focus to something on the page.\n */\nexport class Scroller extends Component<{\n /**\n * A containing element is required - in this case, a div.\n * It must be scrollable for this component to work, but can be customized.\n *\n * By default, this element will have some styling applied:\n * overflow: auto;\n *\n * By default, this element will have tabindex=\"0\" to support keyboard usage.\n *\n * The scroll-behavior is \"auto\", which can be controlled via CSS\n * https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior\n *\n */\n Element: HTMLDivElement;\n Blocks: {\n default: [\n {\n /**\n * Scroll the content to the bottom\n *\n * ```gjs\n * import { Scroller } from 'ember-primitives';\n *\n * <template>\n * <Scroller as |s|>\n * ...\n *\n * {{ (s.scrollToBottom) }}\n * </Scroller>\n * </template>\n * ```\n */\n scrollToBottom: () => void;\n /**\n * Scroll the content to the top\n *\n * ```gjs\n * import { Scroller } from 'ember-primitives';\n *\n * <template>\n * <Scroller as |s|>\n * ...\n *\n * {{ (s.scrollToTop) }}\n * </Scroller>\n * </template>\n * ```\n */\n scrollToTop: () => void;\n /**\n * Scroll the content to the left\n *\n * ```gjs\n * import { Scroller } from 'ember-primitives';\n *\n * <template>\n * <Scroller as |s|>\n * ...\n *\n * {{ (s.scrollToLeft) }}\n * </Scroller>\n * </template>\n * ```\n */\n scrollToLeft: () => void;\n /**\n * Scroll the content to the right\n *\n * ```gjs\n * import { Scroller } from 'ember-primitives';\n *\n * <template>\n * <Scroller as |s|>\n * ...\n *\n * {{ (s.scrollToRight) }}\n * </Scroller>\n * </template>\n * ```\n */\n scrollToRight: () => void;\n },\n ];\n };\n}> {\n declare withinElement: HTMLDivElement;\n\n ref = modifier((el: HTMLDivElement) => {\n this.withinElement = el;\n });\n\n #frame?: number;\n\n scrollToBottom = () => {\n if (this.#frame) {\n cancelAnimationFrame(this.#frame);\n }\n\n this.#frame = requestAnimationFrame(() => {\n if (isDestroyed(this) || isDestroying(this)) return;\n\n this.withinElement.scrollTo({\n top: this.withinElement.scrollHeight,\n behavior: \"auto\",\n });\n });\n };\n\n scrollToTop = () => {\n if (this.#frame) {\n cancelAnimationFrame(this.#frame);\n }\n\n this.#frame = requestAnimationFrame(() => {\n if (isDestroyed(this) || isDestroying(this)) return;\n\n this.withinElement.scrollTo({\n top: 0,\n behavior: \"auto\",\n });\n });\n };\n\n scrollToLeft = () => {\n if (this.#frame) {\n cancelAnimationFrame(this.#frame);\n }\n\n this.#frame = requestAnimationFrame(() => {\n if (isDestroyed(this) || isDestroying(this)) return;\n\n this.withinElement.scrollTo({\n left: 0,\n behavior: \"auto\",\n });\n });\n };\n\n scrollToRight = () => {\n if (this.#frame) {\n cancelAnimationFrame(this.#frame);\n }\n\n this.#frame = requestAnimationFrame(() => {\n if (isDestroyed(this) || isDestroying(this)) return;\n\n this.withinElement.scrollTo({\n left: this.withinElement.scrollWidth,\n behavior: \"auto\",\n });\n });\n };\n\n <template>\n <div tabindex=\"0\" ...attributes {{this.ref}}>\n {{yield\n (hash\n scrollToBottom=this.scrollToBottom\n scrollToTop=this.scrollToTop\n scrollToLeft=this.scrollToLeft\n scrollToRight=this.scrollToRight\n )\n }}\n </div>\n </template>\n}\n"],"names":["Scroller","Component","withinElement","ref","modifier","el","scrollToBottom","cancelAnimationFrame","requestAnimationFrame","isDestroyed","isDestroying","scrollTo","top","scrollHeight","behavior","scrollToTop","scrollToLeft","left","scrollToRight","scrollWidth","setComponentTemplate","precompileTemplate","strictMode","scope","hash"],"mappings":";;;;;;;AAYO,MAAMA,QAAiB,SAAAC,SAAA;EAsFpBC,aAAA;AAERC,EAAAA,GAAM,GAAAC,QAAA,CAAUC,EAAI,IAAA;IAClB,IAAI,CAACH,aAAa,GAAGG,EAAA;AACvB,GAAG,CAAA;AAEH,EAAA,MAAM;EAENC,cAAiB,GAAAA,MAAA;AACf,IAAA,IAAI,IAAI,CAAC,MAAM,EAAE;AACfC,MAAAA,oBAAqB,CAAA,IAAI,CAAC,MAAM,CAAA;AAClC;AAEA,IAAA,IAAI,CAAC,MAAM,GAAGC,qBAAsB,CAAA,MAAA;MAClC,IAAIC,WAAY,CAAA,IAAI,CAAK,IAAAC,YAAA,CAAa,IAAI,CAAG,EAAA;AAE7C,MAAA,IAAI,CAACR,aAAa,CAACS,QAAQ,CAAC;AAC1BC,QAAAA,GAAA,EAAK,IAAI,CAACV,aAAa,CAACW,YAAY;AACpCC,QAAAA,QAAU,EAAA;AACZ,OAAA,CAAA;AACF,KAAA,CAAA;GACA;EAEFC,WAAc,GAAAA,MAAA;AACZ,IAAA,IAAI,IAAI,CAAC,MAAM,EAAE;AACfR,MAAAA,oBAAqB,CAAA,IAAI,CAAC,MAAM,CAAA;AAClC;AAEA,IAAA,IAAI,CAAC,MAAM,GAAGC,qBAAsB,CAAA,MAAA;MAClC,IAAIC,WAAY,CAAA,IAAI,CAAK,IAAAC,YAAA,CAAa,IAAI,CAAG,EAAA;AAE7C,MAAA,IAAI,CAACR,aAAa,CAACS,QAAQ,CAAC;AAC1BC,QAAAA,GAAK,EAAA,CAAA;AACLE,QAAAA,QAAU,EAAA;AACZ,OAAA,CAAA;AACF,KAAA,CAAA;GACA;EAEFE,YAAe,GAAAA,MAAA;AACb,IAAA,IAAI,IAAI,CAAC,MAAM,EAAE;AACfT,MAAAA,oBAAqB,CAAA,IAAI,CAAC,MAAM,CAAA;AAClC;AAEA,IAAA,IAAI,CAAC,MAAM,GAAGC,qBAAsB,CAAA,MAAA;MAClC,IAAIC,WAAY,CAAA,IAAI,CAAK,IAAAC,YAAA,CAAa,IAAI,CAAG,EAAA;AAE7C,MAAA,IAAI,CAACR,aAAa,CAACS,QAAQ,CAAC;AAC1BM,QAAAA,IAAM,EAAA,CAAA;AACNH,QAAAA,QAAU,EAAA;AACZ,OAAA,CAAA;AACF,KAAA,CAAA;GACA;EAEFI,aAAgB,GAAAA,MAAA;AACd,IAAA,IAAI,IAAI,CAAC,MAAM,EAAE;AACfX,MAAAA,oBAAqB,CAAA,IAAI,CAAC,MAAM,CAAA;AAClC;AAEA,IAAA,IAAI,CAAC,MAAM,GAAGC,qBAAsB,CAAA,MAAA;MAClC,IAAIC,WAAY,CAAA,IAAI,CAAK,IAAAC,YAAA,CAAa,IAAI,CAAG,EAAA;AAE7C,MAAA,IAAI,CAACR,aAAa,CAACS,QAAQ,CAAC;AAC1BM,QAAAA,IAAA,EAAM,IAAI,CAACf,aAAa,CAACiB,WAAW;AACpCL,QAAAA,QAAU,EAAA;AACZ,OAAA,CAAA;AACF,KAAA,CAAA;GACA;AAEF,EAAA;IAAAM,oBAAA,CAAAC,kBAAA,CAWA,+NAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
1
+ {"version":3,"file":"scroller.js","sources":["../../src/components/scroller.gts"],"sourcesContent":["import Component from \"@glimmer/component\";\nimport { isDestroyed, isDestroying } from \"@ember/destroyable\";\nimport { hash } from \"@ember/helper\";\n\nimport { modifier } from \"ember-modifier\";\n\n/**\n * Utility component for helping with scrolling in any direction within\n * any of the 4 directions: up, down, left, right.\n *\n * This can be used to auto-scroll content as new content is inserted into the scrollable area, or possibly to bring focus to something on the page.\n */\nexport class Scroller extends Component<{\n /**\n * A containing element is required - in this case, a div.\n * It must be scrollable for this component to work, but can be customized.\n *\n * By default, this element will have some styling applied:\n * overflow: auto;\n *\n * By default, this element will have tabindex=\"0\" to support keyboard usage.\n *\n * The scroll-behavior is \"auto\", which can be controlled via CSS\n * https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior\n *\n */\n Element: HTMLDivElement;\n Blocks: {\n default: [\n {\n /**\n * Scroll the content to the bottom\n *\n * ```gjs\n * import { Scroller } from 'ember-primitives';\n *\n * <template>\n * <Scroller as |s|>\n * ...\n *\n * {{ (s.scrollToBottom) }}\n * </Scroller>\n * </template>\n * ```\n */\n scrollToBottom: () => void;\n /**\n * Scroll the content to the top\n *\n * ```gjs\n * import { Scroller } from 'ember-primitives';\n *\n * <template>\n * <Scroller as |s|>\n * ...\n *\n * {{ (s.scrollToTop) }}\n * </Scroller>\n * </template>\n * ```\n */\n scrollToTop: () => void;\n /**\n * Scroll the content to the left\n *\n * ```gjs\n * import { Scroller } from 'ember-primitives';\n *\n * <template>\n * <Scroller as |s|>\n * ...\n *\n * {{ (s.scrollToLeft) }}\n * </Scroller>\n * </template>\n * ```\n */\n scrollToLeft: () => void;\n /**\n * Scroll the content to the right\n *\n * ```gjs\n * import { Scroller } from 'ember-primitives';\n *\n * <template>\n * <Scroller as |s|>\n * ...\n *\n * {{ (s.scrollToRight) }}\n * </Scroller>\n * </template>\n * ```\n */\n scrollToRight: () => void;\n },\n ];\n };\n}> {\n declare withinElement: HTMLDivElement;\n\n ref = modifier((el: HTMLDivElement) => {\n this.withinElement = el;\n });\n\n #frame?: number;\n\n scrollToBottom = () => {\n if (this.#frame) {\n cancelAnimationFrame(this.#frame);\n }\n\n this.#frame = requestAnimationFrame(() => {\n if (isDestroyed(this) || isDestroying(this)) return;\n\n this.withinElement.scrollTo({\n top: this.withinElement.scrollHeight,\n behavior: \"auto\",\n });\n });\n };\n\n scrollToTop = () => {\n if (this.#frame) {\n cancelAnimationFrame(this.#frame);\n }\n\n this.#frame = requestAnimationFrame(() => {\n if (isDestroyed(this) || isDestroying(this)) return;\n\n this.withinElement.scrollTo({\n top: 0,\n behavior: \"auto\",\n });\n });\n };\n\n scrollToLeft = () => {\n if (this.#frame) {\n cancelAnimationFrame(this.#frame);\n }\n\n this.#frame = requestAnimationFrame(() => {\n if (isDestroyed(this) || isDestroying(this)) return;\n\n this.withinElement.scrollTo({\n left: 0,\n behavior: \"auto\",\n });\n });\n };\n\n scrollToRight = () => {\n if (this.#frame) {\n cancelAnimationFrame(this.#frame);\n }\n\n this.#frame = requestAnimationFrame(() => {\n if (isDestroyed(this) || isDestroying(this)) return;\n\n this.withinElement.scrollTo({\n left: this.withinElement.scrollWidth,\n behavior: \"auto\",\n });\n });\n };\n\n <template>\n <div tabindex=\"0\" ...attributes {{this.ref}}>\n {{yield\n (hash\n scrollToBottom=this.scrollToBottom\n scrollToTop=this.scrollToTop\n scrollToLeft=this.scrollToLeft\n scrollToRight=this.scrollToRight\n )\n }}\n </div>\n </template>\n}\n"],"names":["Scroller","Component","ref","modifier","el","withinElement","scrollToBottom","cancelAnimationFrame","requestAnimationFrame","isDestroyed","isDestroying","scrollTo","top","scrollHeight","behavior","scrollToTop","scrollToLeft","left","scrollToRight","scrollWidth","setComponentTemplate","precompileTemplate","strictMode","scope","hash"],"mappings":";;;;;;;AAYO,MAAMA,QAAiB,SAAAC,SAAA;AAwF5BC,EAAAA,GAAM,GAAAC,QAAA,CAAUC,EAAI,IAAA;IAClB,IAAI,CAACC,aAAa,GAAGD,EAAA;AACvB,GAAG,CAAA;AAEH,EAAA,MAAM;EAENE,cAAiB,GAAAA,MAAA;AACf,IAAA,IAAI,IAAI,CAAC,MAAM,EAAE;AACfC,MAAAA,oBAAqB,CAAA,IAAI,CAAC,MAAM,CAAA;AAClC;AAEA,IAAA,IAAI,CAAC,MAAM,GAAGC,qBAAsB,CAAA,MAAA;MAClC,IAAIC,WAAY,CAA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IAAIC,WAAY,CAAA,IAAI,CAAK,IAAAC,YAAA,CAAa,IAAI,CAAG,EAAA;AAE7C,MAAA,IAAI,CAACL,aAAa,CAACM,QAAQ,CAAC;AAC1BM,QAAAA,IAAA,EAAM,IAAI,CAACZ,aAAa,CAACc,WAAW;AACpCL,QAAAA,QAAU,EAAA;AACZ,OAAA,CAAA;AACF,KAAA,CAAA;GACA;AAEF,EAAA;IAAAM,oBAAA,CAAAC,kBAAA,CAWA,+NAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-primitives",
3
- "version": "0.30.0",
3
+ "version": "0.30.1",
4
4
  "description": "Making apps easier to build",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -24,7 +24,7 @@
24
24
  "decorator-transforms": "^2.3.0",
25
25
  "ember-element-helper": ">= 0.8.6",
26
26
  "form-data-utils": "^0.6.0",
27
- "reactiveweb": "^1.4.0",
27
+ "reactiveweb": "^1.4.2",
28
28
  "should-handle-link": "^1.2.2",
29
29
  "tabster": "^8.5.2",
30
30
  "tracked-built-ins": "^4.0.0",
@@ -47,7 +47,7 @@
47
47
  "@glimmer/tracking": "^1.1.2",
48
48
  "@glint/core": "1.5.2",
49
49
  "@glint/environment-ember-loose": "1.4.1-unstable.5564fc2",
50
- "@glint/environment-ember-template-imports": "1.4.1-unstable.5564fc2",
50
+ "@glint/environment-ember-template-imports": "1.5.2",
51
51
  "@glint/template": "^1.5.2",
52
52
  "@nullvoxpopuli/eslint-configs": "^5.1.1",
53
53
  "@rollup/plugin-babel": "^6.0.4",
@@ -55,7 +55,7 @@
55
55
  "babel-plugin-ember-template-compilation": "^2.4.0",
56
56
  "concurrently": "^9.1.0",
57
57
  "ember-modifier": "^4.1.0",
58
- "ember-resources": "^7.0.0",
58
+ "ember-resources": "^7.0.4",
59
59
  "ember-source": "6.5.0-alpha.2",
60
60
  "ember-template-lint": "^7.0.1",
61
61
  "eslint": "^9.23.0",
@@ -63,7 +63,7 @@
63
63
  "prettier": "^3.2.5",
64
64
  "prettier-plugin-ember-template-tag": "^2.0.4",
65
65
  "publint": "^0.3.9",
66
- "rollup": "~4.38.0",
66
+ "rollup": "~4.40.0",
67
67
  "rollup-plugin-copy": "^3.5.0",
68
68
  "typescript": "^5.8.2"
69
69
  },
@@ -122,11 +122,9 @@
122
122
  "@ember/test-helpers": ">= 3.2.0",
123
123
  "@ember/test-waiters": ">= 3.0.2",
124
124
  "@glimmer/component": "^2.0.0",
125
- "@glimmer/tracking": ">= 1.1.2",
126
125
  "@glint/template": ">= 1.0.0",
127
126
  "ember-modifier": ">= 4.1.0",
128
- "ember-resources": ">= 6.1.0",
129
- "ember-source": "6.5.0-alpha.2"
127
+ "ember-resources": ">= 6.1.0"
130
128
  },
131
129
  "peerDependenciesMeta": {
132
130
  "@ember/test-helpers": {