ember-primitives 0.0.8 → 0.1.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/dist/proper-links.js +24 -7
- package/dist/proper-links.js.map +1 -1
- package/dist-types/proper-links.d.ts.map +1 -1
- package/package.json +11 -11
package/dist/proper-links.js
CHANGED
|
@@ -141,13 +141,30 @@ function handle(router, element, ignore, event) {
|
|
|
141
141
|
* because there is other server-based routing to worry about"
|
|
142
142
|
*/
|
|
143
143
|
if (ignore.includes(url.pathname)) return;
|
|
144
|
-
let
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
144
|
+
let fullHref = `${url.pathname}${url.search}${url.hash}`;
|
|
145
|
+
let rootURL = router.rootURL;
|
|
146
|
+
let withoutRootURL = fullHref.slice(rootURL.length);
|
|
147
|
+
|
|
148
|
+
// re-add the "root" sigil
|
|
149
|
+
// we removed it when we chopped off the rootURL,
|
|
150
|
+
// because the rootURL often has this attached to it as well
|
|
151
|
+
if (!withoutRootURL.startsWith('/')) {
|
|
152
|
+
withoutRootURL = `/${withoutRootURL}`;
|
|
153
|
+
}
|
|
154
|
+
try {
|
|
155
|
+
let routeInfo = router.recognize(fullHref);
|
|
156
|
+
if (routeInfo) {
|
|
157
|
+
event.preventDefault();
|
|
158
|
+
event.stopImmediatePropagation();
|
|
159
|
+
event.stopPropagation();
|
|
160
|
+
router.transitionTo(withoutRootURL);
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
} catch (e) {
|
|
164
|
+
if (e instanceof Error && e.name === 'UnrecognizedURLError') {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
throw e;
|
|
151
168
|
}
|
|
152
169
|
}
|
|
153
170
|
|
package/dist/proper-links.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proper-links.js","sources":["../src/proper-links.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { assert } from '@ember/debug';\nimport { registerDestructor } from '@ember/destroyable';\nimport { getOwner } from '@ember/owner';\n\nimport type EmberRouter from '@ember/routing/router';\nimport type RouterService from '@ember/routing/router-service';\n\ntype Constructor<T extends {} = {}> = { new (...args: any[]): T };\n\nexport interface Options {\n ignore?: string[];\n}\n\nexport function properLinks(\n options: Options\n): <Instance extends {}, Klass = { new (...args: any[]): Instance }>(klass: Klass) => Klass;\n\nexport function properLinks<Instance extends {}, Klass = { new (...args: any[]): Instance }>(\n klass: Klass\n): Klass;\n/**\n * @internal\n */\nexport function properLinks<Instance extends {}, Klass = { new (...args: any[]): Instance }>(\n options: Options,\n klass: Klass\n): Klass;\n\nexport function properLinks<Instance extends {}, Klass = { new (...args: any[]): Instance }>(\n ...args: [Options] | [Klass] | [Options, Klass]\n): Klass | ((klass: Klass) => Klass) {\n let options: Options = {};\n\n let klass: undefined | Klass = undefined;\n\n if (args.length === 2) {\n options = args[0] as Options;\n klass = args[1] as Klass;\n } else if (args.length === 1) {\n if (typeof args[0] === 'object') {\n // TODO: how to get first arg type correct?\n return (klass: Klass) => properLinks(args[0] as any, klass);\n } else {\n klass = args[0];\n }\n }\n\n let ignore = options.ignore || [];\n\n assert(`klass was not defined. possibile incorrect arity given to properLinks`, klass);\n\n return class RouterWithProperLinks extends (klass as unknown as Constructor<EmberRouter>) {\n // SAFETY: we literally do not care about the args' type here,\n // because we just call super\n constructor(...args: any[]) {\n super(...args);\n\n setup(this, ignore);\n }\n } as unknown as Klass;\n}\n\n/**\n * Setup proper links without a decorator.\n * This function only requires that a framework object with an owner is passed.\n */\nexport function setup(parent: object, ignore?: string[]) {\n const handler = (event: MouseEvent) => {\n /**\n * event.target may not be an anchor,\n * it may be a span, svg, img, or any number of elements nested in <a>...</a>\n */\n let interactive = isLink(event);\n\n if (!interactive) return;\n\n let owner = getOwner(parent);\n\n assert('owner is not present', owner);\n\n let routerService = owner.lookup('service:router');\n\n handle(routerService, interactive, ignore ?? [], event);\n };\n\n document.body.addEventListener('click', handler, false);\n\n registerDestructor(parent, () => document.body.removeEventListener('click', handler));\n}\n\nexport function isLink(event: Event) {\n /**\n * Using composed path in case the link is removed from the DOM\n * before the event handler evaluates\n */\n let composedPath = event.composedPath();\n\n for (let element of composedPath) {\n if (element instanceof HTMLAnchorElement) {\n return element;\n }\n }\n}\n\nexport function handle(\n router: RouterService,\n element: HTMLAnchorElement,\n ignore: string[],\n event: MouseEvent\n) {\n if (!element) return;\n /**\n * If we don't have an href, the <a> is invalid.\n * If you're debugging your code and end up finding yourself\n * early-returning here, please add an href ;)\n */\n if (!element.href) return;\n\n /**\n * This is partially an escape hatch, but any time target is set,\n * we are usually wanting to escape the behavior of single-page-apps.\n *\n * Some folks desire to have in-SPA links, but still do native browser behavior\n * (which for the case of SPAs is a full page refresh)\n * but they can set target=\"_self\" to get that behavior back if they want.\n *\n * I expect that this'll be a super edge case, because the whole goal of\n * \"proper links\" is to do what is expected, always -- for in-app SPA links\n * as well as external, cross-domain links\n */\n if (element.target) return;\n\n /**\n * If the click is not a \"left click\" we don't want to intercept the event.\n * This allows folks to\n * - middle click (usually open the link in a new tab)\n * - right click (usually opens the context menu)\n */\n if (event.button !== 0) return;\n\n /**\n * for MacOS users, this default behavior opens the link in a new tab\n */\n if (event.metaKey) return;\n\n /**\n * for for everyone else, this default behavior opens the link in a new tab\n */\n if (event.ctrlKey) return;\n\n /**\n * The default behavior here downloads the link content\n */\n if (event.altKey) return;\n\n /**\n * The default behavior here opens the link in a new window\n */\n if (event.shiftKey) return;\n\n /**\n * If another event listener called event.preventDefault(), we don't want to proceed.\n */\n if (event.defaultPrevented) return;\n\n /**\n * The href includes the protocol/host/etc\n * In order to not have the page look like a full page refresh,\n * we need to chop that \"origin\" off, and just use the path\n */\n let url = new URL(element.href);\n\n /**\n * If the domains are different, we want to fall back to normal link behavior\n *\n */\n if (location.origin !== url.origin) return;\n\n /**\n * We can optionally declare some paths as ignored,\n * or \"let the browser do its default thing,\n * because there is other server-based routing to worry about\"\n */\n if (ignore.includes(url.pathname)) return;\n\n let routeInfo = router.recognize(url.pathname);\n\n if (routeInfo) {\n event.preventDefault();\n event.stopImmediatePropagation();\n event.stopPropagation();\n\n router.transitionTo(url.pathname);\n\n return false;\n }\n}\n"],"names":["properLinks","args","options","klass","undefined","length","ignore","assert","RouterWithProperLinks","constructor","setup","parent","handler","event","interactive","isLink","owner","getOwner","routerService","lookup","handle","document","body","addEventListener","registerDestructor","removeEventListener","composedPath","element","HTMLAnchorElement","router","href","target","button","metaKey","ctrlKey","altKey","shiftKey","defaultPrevented","url","URL","location","origin","includes","pathname","routeInfo","recognize","preventDefault","stopImmediatePropagation","stopPropagation","transitionTo"],"mappings":";;;;AAAA;;AAqBA;AACA;AACA;;AAMO,SAASA,WAAWA,CACzB,GAAGC,IAA4C,EACZ;EACnC,IAAIC,OAAgB,GAAG,EAAE,CAAA;EAEzB,IAAIC,KAAwB,GAAGC,SAAS,CAAA;AAExC,EAAA,IAAIH,IAAI,CAACI,MAAM,KAAK,CAAC,EAAE;AACrBH,IAAAA,OAAO,GAAGD,IAAI,CAAC,CAAC,CAAY,CAAA;AAC5BE,IAAAA,KAAK,GAAGF,IAAI,CAAC,CAAC,CAAU,CAAA;AAC1B,GAAC,MAAM,IAAIA,IAAI,CAACI,MAAM,KAAK,CAAC,EAAE;AAC5B,IAAA,IAAI,OAAOJ,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;AAC/B;MACA,OAAQE,KAAY,IAAKH,WAAW,CAACC,IAAI,CAAC,CAAC,CAAC,EAASE,KAAK,CAAC,CAAA;AAC7D,KAAC,MAAM;AACLA,MAAAA,KAAK,GAAGF,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,KAAA;AACF,GAAA;AAEA,EAAA,IAAIK,MAAM,GAAGJ,OAAO,CAACI,MAAM,IAAI,EAAE,CAAA;AAEjCC,EAAAA,MAAM,CAAE,CAAA,qEAAA,CAAsE,EAAEJ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AAA;IACtBjC,KAAK,CAACkC,wBAAwB,EAAE,CAAA;IAChClC,KAAK,CAACmC,eAAe,EAAE,CAAA;AAEvBnB,IAAAA,MAAM,CAACoB,YAAY,CAACX,GAAG,CAACK,QAAQ,CAAC,CAAA;AAEjC,IAAA,OAAO,KAAK,CAAA;AACd,GAAA;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"proper-links.js","sources":["../src/proper-links.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { assert } from '@ember/debug';\nimport { registerDestructor } from '@ember/destroyable';\nimport { getOwner } from '@ember/owner';\n\nimport type EmberRouter from '@ember/routing/router';\nimport type RouterService from '@ember/routing/router-service';\n\ntype Constructor<T extends {} = {}> = { new (...args: any[]): T };\n\nexport interface Options {\n ignore?: string[];\n}\n\nexport function properLinks(\n options: Options\n): <Instance extends {}, Klass = { new (...args: any[]): Instance }>(klass: Klass) => Klass;\n\nexport function properLinks<Instance extends {}, Klass = { new (...args: any[]): Instance }>(\n klass: Klass\n): Klass;\n/**\n * @internal\n */\nexport function properLinks<Instance extends {}, Klass = { new (...args: any[]): Instance }>(\n options: Options,\n klass: Klass\n): Klass;\n\nexport function properLinks<Instance extends {}, Klass = { new (...args: any[]): Instance }>(\n ...args: [Options] | [Klass] | [Options, Klass]\n): Klass | ((klass: Klass) => Klass) {\n let options: Options = {};\n\n let klass: undefined | Klass = undefined;\n\n if (args.length === 2) {\n options = args[0] as Options;\n klass = args[1] as Klass;\n } else if (args.length === 1) {\n if (typeof args[0] === 'object') {\n // TODO: how to get first arg type correct?\n return (klass: Klass) => properLinks(args[0] as any, klass);\n } else {\n klass = args[0];\n }\n }\n\n let ignore = options.ignore || [];\n\n assert(`klass was not defined. possibile incorrect arity given to properLinks`, klass);\n\n return class RouterWithProperLinks extends (klass as unknown as Constructor<EmberRouter>) {\n // SAFETY: we literally do not care about the args' type here,\n // because we just call super\n constructor(...args: any[]) {\n super(...args);\n\n setup(this, ignore);\n }\n } as unknown as Klass;\n}\n\n/**\n * Setup proper links without a decorator.\n * This function only requires that a framework object with an owner is passed.\n */\nexport function setup(parent: object, ignore?: string[]) {\n const handler = (event: MouseEvent) => {\n /**\n * event.target may not be an anchor,\n * it may be a span, svg, img, or any number of elements nested in <a>...</a>\n */\n let interactive = isLink(event);\n\n if (!interactive) return;\n\n let owner = getOwner(parent);\n\n assert('owner is not present', owner);\n\n let routerService = owner.lookup('service:router');\n\n handle(routerService, interactive, ignore ?? [], event);\n };\n\n document.body.addEventListener('click', handler, false);\n\n registerDestructor(parent, () => document.body.removeEventListener('click', handler));\n}\n\nexport function isLink(event: Event) {\n /**\n * Using composed path in case the link is removed from the DOM\n * before the event handler evaluates\n */\n let composedPath = event.composedPath();\n\n for (let element of composedPath) {\n if (element instanceof HTMLAnchorElement) {\n return element;\n }\n }\n}\n\nexport function handle(\n router: RouterService,\n element: HTMLAnchorElement,\n ignore: string[],\n event: MouseEvent\n) {\n if (!element) return;\n /**\n * If we don't have an href, the <a> is invalid.\n * If you're debugging your code and end up finding yourself\n * early-returning here, please add an href ;)\n */\n if (!element.href) return;\n\n /**\n * This is partially an escape hatch, but any time target is set,\n * we are usually wanting to escape the behavior of single-page-apps.\n *\n * Some folks desire to have in-SPA links, but still do native browser behavior\n * (which for the case of SPAs is a full page refresh)\n * but they can set target=\"_self\" to get that behavior back if they want.\n *\n * I expect that this'll be a super edge case, because the whole goal of\n * \"proper links\" is to do what is expected, always -- for in-app SPA links\n * as well as external, cross-domain links\n */\n if (element.target) return;\n\n /**\n * If the click is not a \"left click\" we don't want to intercept the event.\n * This allows folks to\n * - middle click (usually open the link in a new tab)\n * - right click (usually opens the context menu)\n */\n if (event.button !== 0) return;\n\n /**\n * for MacOS users, this default behavior opens the link in a new tab\n */\n if (event.metaKey) return;\n\n /**\n * for for everyone else, this default behavior opens the link in a new tab\n */\n if (event.ctrlKey) return;\n\n /**\n * The default behavior here downloads the link content\n */\n if (event.altKey) return;\n\n /**\n * The default behavior here opens the link in a new window\n */\n if (event.shiftKey) return;\n\n /**\n * If another event listener called event.preventDefault(), we don't want to proceed.\n */\n if (event.defaultPrevented) return;\n\n /**\n * The href includes the protocol/host/etc\n * In order to not have the page look like a full page refresh,\n * we need to chop that \"origin\" off, and just use the path\n */\n let url = new URL(element.href);\n\n /**\n * If the domains are different, we want to fall back to normal link behavior\n *\n */\n if (location.origin !== url.origin) return;\n\n /**\n * We can optionally declare some paths as ignored,\n * or \"let the browser do its default thing,\n * because there is other server-based routing to worry about\"\n */\n if (ignore.includes(url.pathname)) return;\n\n let fullHref = `${url.pathname}${url.search}${url.hash}`;\n\n let rootURL = router.rootURL;\n\n let withoutRootURL = fullHref.slice(rootURL.length);\n\n // re-add the \"root\" sigil\n // we removed it when we chopped off the rootURL,\n // because the rootURL often has this attached to it as well\n if (!withoutRootURL.startsWith('/')) {\n withoutRootURL = `/${withoutRootURL}`;\n }\n\n try {\n let routeInfo = router.recognize(fullHref);\n\n if (routeInfo) {\n event.preventDefault();\n event.stopImmediatePropagation();\n event.stopPropagation();\n\n router.transitionTo(withoutRootURL);\n\n return false;\n }\n } catch (e) {\n if (e instanceof Error && e.name === 'UnrecognizedURLError') {\n return;\n }\n\n throw e;\n }\n}\n"],"names":["properLinks","args","options","klass","undefined","length","ignore","assert","RouterWithProperLinks","constructor","setup","parent","handler","event","interactive","isLink","owner","getOwner","routerService","lookup","handle","document","body","addEventListener","registerDestructor","removeEventListener","composedPath","element","HTMLAnchorElement","router","href","target","button","metaKey","ctrlKey","altKey","shiftKey","defaultPrevented","url","URL","location","origin","includes","pathname","fullHref","search","hash","rootURL","withoutRootURL","slice","startsWith","routeInfo","recognize","preventDefault","stopImmediatePropagation","stopPropagation","transitionTo","e","Error","name"],"mappings":";;;;AAAA;;AAqBA;AACA;AACA;;AAMO,SAASA,WAAWA,CACzB,GAAGC,IAA4C,EACZ;EACnC,IAAIC,OAAgB,GAAG,EAAE,CAAA;EAEzB,IAAIC,KAAwB,GAAGC,SAAS,CAAA;AAEx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,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,MAAM,EAAE,EAChB,KAAK,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"proper-links.d.ts","sourceRoot":"","sources":["../src/proper-links.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAI/D,MAAM,WAAW,OAAO;IACtB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,wBAAgB,WAAW,CACzB,OAAO,EAAE,OAAO,GACf,CAAC,QAAQ,SAAS,EAAE,EAAE,KAAK,GAAG;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,QAAQ,CAAA;CAAE,EAAE,KAAK,EAAE,KAAK,KAAK,KAAK,CAAC;AAE5F,wBAAgB,WAAW,CAAC,QAAQ,SAAS,EAAE,EAAE,KAAK,GAAG;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,QAAQ,CAAA;CAAE,EACzF,KAAK,EAAE,KAAK,GACX,KAAK,CAAC;AACT;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,SAAS,EAAE,EAAE,KAAK,GAAG;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,QAAQ,CAAA;CAAE,EACzF,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACX,KAAK,CAAC;AAoCT;;;GAGG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,QAsBtD;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,KAAK,iCAYlC;AAED,wBAAgB,MAAM,CACpB,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,MAAM,EAAE,EAChB,KAAK,EAAE,UAAU,qBA6GlB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-primitives",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Making apps easier to build",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"tracked-toolbox": "^2.0.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@arethetypeswrong/cli": "^0.
|
|
25
|
+
"@arethetypeswrong/cli": "^0.7.1",
|
|
26
26
|
"@babel/core": "^7.22.5",
|
|
27
27
|
"@babel/eslint-parser": "^7.22.5",
|
|
28
28
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
@@ -50,15 +50,15 @@
|
|
|
50
50
|
"ember-resources": "^6.1.1",
|
|
51
51
|
"ember-source": "~5.1.2",
|
|
52
52
|
"ember-template-imports": "^3.4.2",
|
|
53
|
-
"ember-template-lint": "^5.11.
|
|
54
|
-
"eslint": "^8.
|
|
53
|
+
"ember-template-lint": "^5.11.1",
|
|
54
|
+
"eslint": "^8.46.0",
|
|
55
55
|
"eslint-config-prettier": "^8.3.0",
|
|
56
|
-
"eslint-plugin-ember": "^11.
|
|
56
|
+
"eslint-plugin-ember": "^11.10.0",
|
|
57
57
|
"eslint-plugin-node": "^11.1.0",
|
|
58
58
|
"eslint-plugin-prettier": "^4.0.0",
|
|
59
59
|
"prettier": "^2.8.8",
|
|
60
60
|
"prettier-plugin-ember-template-tag": "^0.3.2",
|
|
61
|
-
"publint": "^0.
|
|
61
|
+
"publint": "^0.2.0",
|
|
62
62
|
"rollup": "~3.26.0",
|
|
63
63
|
"rollup-plugin-copy": "^3.4.0",
|
|
64
64
|
"rollup-plugin-glimmer-template-tag": "^0.4.1",
|
|
@@ -109,11 +109,11 @@
|
|
|
109
109
|
"extends": "../package.json"
|
|
110
110
|
},
|
|
111
111
|
"peerDependencies": {
|
|
112
|
-
"@glimmer/component": "
|
|
113
|
-
"@glimmer/tracking": "
|
|
114
|
-
"ember-modifier": "
|
|
115
|
-
"ember-resources": "
|
|
116
|
-
"ember-source": "
|
|
112
|
+
"@glimmer/component": ">= 1.1.2",
|
|
113
|
+
"@glimmer/tracking": ">= 1.1.2",
|
|
114
|
+
"ember-modifier": ">= 4.1.0",
|
|
115
|
+
"ember-resources": ">= 6.1.0",
|
|
116
|
+
"ember-source": ">= 4.12.0"
|
|
117
117
|
},
|
|
118
118
|
"scripts": {
|
|
119
119
|
"build": "concurrently 'npm:build:*'",
|