@docfy/ember 0.11.0 → 0.12.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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Josemar Luedke
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,4 +1,3 @@
1
-
2
1
  import Component from '@glimmer/component';
3
2
  import { tracked } from '@glimmer/tracking';
4
3
  import { action } from '@ember/object';
@@ -21,14 +20,14 @@ const docfyEq = helper(function docfyEq(params) {
21
20
 
22
21
  class DocfyDemoDescription extends Component {
23
22
  static {
24
- setComponentTemplate(precompileTemplate("\n <div class=\"docfy-demo__description\" data-test-id=\"demo-description\" ...attributes>\n <div class=\"docfy-demo__description__header\" data-test-id=\"demo-header\">\n {{#if @title}}\n <h3 class=\"docfy-demo__description__header__title\" data-test-id=\"demo-title\">\n <a href=\"#{{@id}}\">\n <span class=\"icon icon-link\"></span>\n </a>\n {{@title}}\n </h3>\n {{/if}}\n {{#if @editUrl}}\n <a href={{@editUrl}} target=\"_blank\" rel=\"noopener noreferrer\" class=\"docfy-demo__description__header__edit-url\" data-test-id=\"demo-edit-url\">\n Edit this demo\n </a>\n {{/if}}\n </div>\n\n <div class=\"docfy-demo__description__content\" data-test-id=\"demo-content\">\n {{yield}}\n </div>\n </div>\n ", {
23
+ setComponentTemplate(precompileTemplate("<div class=\"docfy-demo__description\" data-test-id=\"demo-description\" ...attributes>\n <div class=\"docfy-demo__description__header\" data-test-id=\"demo-header\">\n {{#if @title}}\n <h3 class=\"docfy-demo__description__header__title\" data-test-id=\"demo-title\">\n <a href=\"#{{@id}}\">\n <span class=\"icon icon-link\"></span>\n </a>\n {{@title}}\n </h3>\n {{/if}}\n {{#if @editUrl}}\n <a href={{@editUrl}} target=\"_blank\" rel=\"noopener noreferrer\" class=\"docfy-demo__description__header__edit-url\" data-test-id=\"demo-edit-url\">\n Edit this demo\n </a>\n {{/if}}\n </div>\n\n <div class=\"docfy-demo__description__content\" data-test-id=\"demo-content\">\n {{yield}}\n </div>\n</div>", {
25
24
  strictMode: true
26
25
  }), this);
27
26
  }
28
27
  }
29
28
  // Example subcomponent
30
29
 
31
- const DocfyDemoExample = setComponentTemplate(precompileTemplate("\n <div class=\"docfy-demo__example__container\" data-test-id=\"demo-example__container\" ...attributes>\n <div class=\"docfy-demo__example not-prose\" data-test-id=\"demo-example\" ...attributes>\n {{yield}}\n </div>\n </div>\n", {
30
+ const DocfyDemoExample = setComponentTemplate(precompileTemplate("<div class=\"docfy-demo__example__container\" data-test-id=\"demo-example__container\" ...attributes>\n <div class=\"docfy-demo__example not-prose\" data-test-id=\"demo-example\" ...attributes>\n {{yield}}\n </div>\n</div>", {
32
31
  strictMode: true
33
32
  }), templateOnly());
34
33
  // Snippet subcomponent
@@ -53,7 +52,7 @@ class DocfyDemoSnippet extends Component {
53
52
  return this.id === this.args.active;
54
53
  }
55
54
  static {
56
- setComponentTemplate(precompileTemplate("\n {{#if this.isActive}}\n <div class=\"docfy-demo__snippet\" data-test-id=\"demo-snippet\" data-test-snippet-name=\"{{@name}}\" ...attributes>\n {{yield}}\n </div>\n {{/if}}\n ", {
55
+ setComponentTemplate(precompileTemplate("{{#if this.isActive}}\n <div class=\"docfy-demo__snippet\" data-test-id=\"demo-snippet\" data-test-snippet-name=\"{{@name}}\" ...attributes>\n {{yield}}\n </div>\n{{/if}}", {
57
56
  strictMode: true
58
57
  }), this);
59
58
  }
@@ -89,7 +88,7 @@ class DocfyDemoSnippets extends Component {
89
88
  n(this.prototype, "setActiveSnippet", [action]);
90
89
  }
91
90
  static {
92
- setComponentTemplate(precompileTemplate("\n <div class=\"docfy-demo__snippets\" data-test-id=\"demo-snippets\">\n <div class=\"docfy-demo__snippets__tabs\" data-test-id=\"demo-tabs\">\n {{#each this.snippets as |snippet|}}\n <button type=\"button\" class=\"docfy-demo__snippets__tabs__button\n {{if (docfyEq this.active snippet.id) \"docfy-demo__snippets__tabs__button--active\"}}\" data-test-id=\"demo-tab-button\" data-test-snippet-name=\"{{snippet.name}}\" data-test-is-active=\"{{if (docfyEq this.active snippet.id) \"true\" \"false\"}}\" {{on \"click\" (fn this.setActiveSnippet snippet.id)}}>\n {{snippet.name}}\n </button>\n {{/each}}\n </div>\n\n {{yield (component DocfyDemoSnippet registerSnippet=this.registerSnippet active=this.active)}}\n </div>\n ", {
91
+ setComponentTemplate(precompileTemplate("<div class=\"docfy-demo__snippets\" data-test-id=\"demo-snippets\">\n <div class=\"docfy-demo__snippets__tabs\" data-test-id=\"demo-tabs\">\n {{#each this.snippets as |snippet|}}\n <button type=\"button\" class=\"docfy-demo__snippets__tabs__button\n {{if (docfyEq this.active snippet.id) \"docfy-demo__snippets__tabs__button--active\"}}\" data-test-id=\"demo-tab-button\" data-test-snippet-name=\"{{snippet.name}}\" data-test-is-active=\"{{if (docfyEq this.active snippet.id) \"true\" \"false\"}}\" {{on \"click\" (fn this.setActiveSnippet snippet.id)}}>\n {{snippet.name}}\n </button>\n {{/each}}\n </div>\n\n {{yield (component DocfyDemoSnippet registerSnippet=this.registerSnippet active=this.active)}}\n</div>", {
93
92
  strictMode: true,
94
93
  scope: () => ({
95
94
  docfyEq,
@@ -104,7 +103,7 @@ class DocfyDemoSnippets extends Component {
104
103
 
105
104
  class DocfyDemo extends Component {
106
105
  static {
107
- setComponentTemplate(precompileTemplate("\n <div id={{@id}} class=\"docfy-demo\" data-test-id=\"docfy-demo\" data-test-demo-id=\"{{@id}}\" ...attributes>\n {{yield (hash Example=DocfyDemoExample Description=(component DocfyDemoDescription id=@id) Snippet=DocfyDemoSnippet Snippets=DocfyDemoSnippets)}}\n </div>\n ", {
106
+ setComponentTemplate(precompileTemplate("<div id={{@id}} class=\"docfy-demo\" data-test-id=\"docfy-demo\" data-test-demo-id=\"{{@id}}\" ...attributes>\n {{yield (hash Example=DocfyDemoExample Description=(component DocfyDemoDescription id=@id) Snippet=DocfyDemoSnippet Snippets=DocfyDemoSnippets)}}\n</div>", {
108
107
  strictMode: true,
109
108
  scope: () => ({
110
109
  hash,
@@ -1 +1 @@
1
- {"version":3,"file":"docfy-demo.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"docfy-demo.js","sources":["../../src/components/docfy-demo.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { guidFor } from '@ember/object/internals';\nimport { schedule } from '@ember/runloop';\nimport { helper } from '@ember/component/helper';\nimport { on } from '@ember/modifier';\nimport { fn } from '@ember/helper';\nimport { hash } from '@ember/helper';\nimport type Owner from '@ember/owner';\nimport type { TOC } from '@ember/component/template-only';\n\n// Helper function for equality comparison\nconst docfyEq = helper(function docfyEq(params: unknown[]): boolean {\n return params[0] === params[1];\n});\n\n// Shared type for snippet registration\ninterface SnippetRegisterArgs {\n id: string;\n name: string;\n}\n\n// Description subcomponent\ninterface DocfyDemoDescriptionArgs {\n id?: string;\n title?: string;\n editUrl?: string;\n}\n\ninterface DocfyDemoDescriptionSignature {\n Args: DocfyDemoDescriptionArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nclass DocfyDemoDescription extends Component<DocfyDemoDescriptionSignature> {\n <template>\n <div\n class=\"docfy-demo__description\"\n data-test-id=\"demo-description\"\n ...attributes\n >\n <div class=\"docfy-demo__description__header\" data-test-id=\"demo-header\">\n {{#if @title}}\n <h3\n class=\"docfy-demo__description__header__title\"\n data-test-id=\"demo-title\"\n >\n <a href=\"#{{@id}}\">\n <span class=\"icon icon-link\"></span>\n </a>\n {{@title}}\n </h3>\n {{/if}}\n {{#if @editUrl}}\n <a\n href={{@editUrl}}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"docfy-demo__description__header__edit-url\"\n data-test-id=\"demo-edit-url\"\n >\n Edit this demo\n </a>\n {{/if}}\n </div>\n\n <div class=\"docfy-demo__description__content\" data-test-id=\"demo-content\">\n {{yield}}\n </div>\n </div>\n </template>\n}\n\n// Example subcomponent\ninterface DocfyDemoExampleSignature {\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nconst DocfyDemoExample: TOC<DocfyDemoExampleSignature> = <template>\n <div\n class=\"docfy-demo__example__container\"\n data-test-id=\"demo-example__container\"\n ...attributes\n >\n <div\n class=\"docfy-demo__example not-prose\"\n data-test-id=\"demo-example\"\n ...attributes\n >\n {{yield}}\n </div>\n </div>\n</template>;\n\n// Snippet subcomponent\ninterface DocfyDemoSnippetArgs {\n name: string;\n active: string;\n registerSnippet: (snippet: SnippetRegisterArgs) => void;\n}\n\ninterface DocfyDemoSnippetSignature {\n Args: DocfyDemoSnippetArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nclass DocfyDemoSnippet extends Component<DocfyDemoSnippetSignature> {\n id = guidFor(this);\n\n constructor(owner: Owner, args: DocfyDemoSnippetArgs) {\n super(owner, args);\n\n if (typeof this.args.registerSnippet === 'function') {\n let name = this.args.name || '';\n name = name.charAt(0).toUpperCase() + name.slice(1);\n\n this.args.registerSnippet({\n id: this.id,\n name,\n });\n }\n }\n\n get isActive(): boolean {\n if (typeof this.args.registerSnippet !== 'function') {\n return true;\n }\n\n return this.id === this.args.active;\n }\n\n <template>\n {{#if this.isActive}}\n <div\n class=\"docfy-demo__snippet\"\n data-test-id=\"demo-snippet\"\n data-test-snippet-name=\"{{@name}}\"\n ...attributes\n >\n {{yield}}\n </div>\n {{/if}}\n </template>\n}\n\n// Snippets subcomponent\ninterface DocfyDemoSnippetsSignature {\n Blocks: {\n default: [any];\n };\n}\n\nclass DocfyDemoSnippets extends Component<DocfyDemoSnippetsSignature> {\n @tracked snippets: SnippetRegisterArgs[] = [];\n @tracked active?: string;\n\n @action registerSnippet(snippet: SnippetRegisterArgs): void {\n schedule('render', this, () => {\n this.snippets = [...this.snippets, snippet];\n if (!this.active) {\n this.active = snippet.id;\n }\n });\n }\n\n @action setActiveSnippet(id: string): void {\n this.active = id;\n }\n\n <template>\n <div class=\"docfy-demo__snippets\" data-test-id=\"demo-snippets\">\n <div class=\"docfy-demo__snippets__tabs\" data-test-id=\"demo-tabs\">\n {{#each this.snippets as |snippet|}}\n <button\n type=\"button\"\n class=\"docfy-demo__snippets__tabs__button\n {{if\n (docfyEq this.active snippet.id)\n 'docfy-demo__snippets__tabs__button--active'\n }}\"\n data-test-id=\"demo-tab-button\"\n data-test-snippet-name=\"{{snippet.name}}\"\n data-test-is-active=\"{{if\n (docfyEq this.active snippet.id)\n 'true'\n 'false'\n }}\"\n {{on \"click\" (fn this.setActiveSnippet snippet.id)}}\n >\n {{snippet.name}}\n </button>\n {{/each}}\n </div>\n\n {{yield\n (component\n DocfyDemoSnippet\n registerSnippet=this.registerSnippet\n active=this.active\n )\n }}\n </div>\n </template>\n}\n\n// Main DocfyDemo component\ninterface DocfyDemoArgs {\n id: string;\n}\n\ninterface DocfyDemoSignature {\n Args: DocfyDemoArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [\n {\n Example: TOC<DocfyDemoExampleSignature>;\n Description: any;\n Snippet: any;\n Snippets: typeof DocfyDemoSnippets;\n },\n ];\n };\n}\n\nexport default class DocfyDemo extends Component<DocfyDemoSignature> {\n <template>\n <div\n id={{@id}}\n class=\"docfy-demo\"\n data-test-id=\"docfy-demo\"\n data-test-demo-id=\"{{@id}}\"\n ...attributes\n >\n {{yield\n (hash\n Example=DocfyDemoExample\n Description=(component DocfyDemoDescription id=@id)\n Snippet=DocfyDemoSnippet\n Snippets=DocfyDemoSnippets\n )\n }}\n </div>\n </template>\n}\n"],"names":["docfyEq","helper","params","DocfyDemoDescription","Component","setComponentTemplate","precompileTemplate","strictMode","DocfyDemoExample","templateOnly","DocfyDemoSnippet","id","guidFor","constructor","owner","args","registerSnippet","name","charAt","toUpperCase","slice","isActive","active","DocfyDemoSnippets","g","prototype","tracked","i","snippet","schedule","snippets","n","action","setActiveSnippet","scope","on","fn","DocfyDemo","hash"],"mappings":";;;;;;;;;;;;;AAaA,MAAMA,OAAA,GAAUC,OAAO,SAASD,OAAAA,CAAQE,MAAiB,EAAU;EACjE,OAAOA,MAAM,CAAC,CAAA,CAAE,KAAKA,MAAM,CAAC,CAAA,CAAE;AAChC,CAAA,CAAA;AAEA;;AAMA;;AAeA,MAAMC,6BAA6BC,SAAA,CAAU;AAC3C,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,uwBAAA,EAmCA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;AAEA;;AAQA,MAAMC,gBAAsB,GAAAH,oBAAA,CAA6BC,kBAAA,CAAA,qOAAA,EAczD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAE,YAAA,EAAA,CAAA;AAEV;;AAeA,MAAMC,yBAAyBN,SAAA,CAAU;AACvCO,EAAAA,EAAA,GAAKC,OAAA,CAAQ,IAAI,CAAA;AAEjBC,EAAAA,WAA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} from '@ember/service';
4
3
  import { action } from '@ember/object';
@@ -45,7 +44,7 @@ class DocfyLink extends Component {
45
44
  n(this.prototype, "navigate", [action]);
46
45
  }
47
46
  static {
48
- setComponentTemplate(precompileTemplate("\n <a class=\"docfy-link {{if this.isActive @activeClass}}\" ...attributes href={{this.href}} data-test-docfy-link data-test-to={{@to}} data-test-anchor={{@anchor}} data-test-is-active={{this.isActive}} {{on \"click\" this.navigate}}>\n {{yield}}\n </a>\n ", {
47
+ setComponentTemplate(precompileTemplate("<a class=\"docfy-link {{if this.isActive @activeClass}}\" ...attributes href={{this.href}} data-test-docfy-link data-test-to={{@to}} data-test-anchor={{@anchor}} data-test-is-active={{this.isActive}} {{on \"click\" this.navigate}}>\n {{yield}}\n</a>", {
49
48
  strictMode: true,
50
49
  scope: () => ({
51
50
  on
@@ -1 +1 @@
1
- {"version":3,"file":"docfy-link.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"docfy-link.js","sources":["../../src/components/docfy-link.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { service } from '@ember/service';\nimport { action } from '@ember/object';\nimport { on } from '@ember/modifier';\nimport type RouterService from '@ember/routing/router-service';\n\ninterface DocfyLinkArgs {\n to: string;\n anchor?: string;\n activeClass?: string;\n}\n\ninterface DocfyLinkSignature {\n Args: DocfyLinkArgs;\n Element: HTMLAnchorElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class DocfyLink extends Component<DocfyLinkSignature> {\n @service('router') declare router: RouterService;\n\n get routeName(): string | undefined {\n const { to } = this.args;\n\n return this.router.recognize(to)?.name;\n }\n\n get href(): string {\n let url = this.args.to;\n if (this.routeName) {\n url = this.router.urlFor(this.routeName);\n }\n\n if (this.args.anchor) {\n return `${url}#${this.args.anchor}`;\n } else {\n return url;\n }\n }\n\n get isActive(): boolean {\n return this.router.currentRouteName === this.routeName;\n }\n\n @action\n navigate(event: MouseEvent): void {\n if (event.ctrlKey || event.metaKey) {\n return;\n }\n\n if (this.routeName && !this.args.anchor) {\n event.preventDefault();\n this.router.transitionTo(this.routeName);\n }\n }\n\n <template>\n <a\n class=\"docfy-link {{if this.isActive @activeClass}}\"\n ...attributes\n href={{this.href}}\n data-test-docfy-link\n data-test-to={{@to}}\n data-test-anchor={{@anchor}}\n data-test-is-active={{this.isActive}}\n {{on \"click\" this.navigate}}\n >\n {{yield}}\n </a>\n </template>\n}\n"],"names":["DocfyLink","Component","g","prototype","service","i","routeName","to","args","router","recognize","name","href","url","urlFor","anchor","isActive","currentRouteName","navigate","event","ctrlKey","metaKey","preventDefault","transitionTo","n","action","setComponentTemplate","precompileTemplate","strictMode","scope","on"],"mappings":";;;;;;;;AAoBe,MAAMA,kBAAkBC,SAAA,CAAU;AAAA,EAAA;AAAAC,IAAAA,CAAA,MAAAC,SAAA,EAAA,QAAA,EAAA,CAC9CC,OAAA,CAAQ,QAAA,CAAA,CAAA,CAAA;AAAA;EAAA,OAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,QAAA,CAAA,EAAA,MAAA;EAET,IAAIC,SAAAA,GAAgC;IAClC,MAAM;AAAEC,MAAAA;KAAI,GAAG,IAAI,CAACC,IAAI;IAExB,OAAO,IAAI,CAACC,MAAM,CAACC,SAAS,CAACH,EAAA,CAAA,EAAKI,IAAA;AACpC,EAAA;EAEA,IAAIC,IAAAA,GAAe;AACjB,IAAA,IAAIC,GAAA,GAAM,IAAI,CAACL,IAAI,CAACD,EAAE;IACtB,IAAI,IAAI,CAACD,SAAS,EAAE;MAClBO,GAAA,GAAM,IAAI,CAACJ,MAAM,CAACK,MAAM,CAAC,IAAI,CAACR,SAAS,CAAA;AACzC,IAAA;AAEA,IAAA,IAAI,IAAI,CAACE,IAAI,CAACO,MAAM,EAAE;MACpB,OAAO,CAAA,EAAGF,OAAO,IAAI,CAACL,IAAI,CAACO,MAAM,CAAA,CAAE;AACrC,IAAA,CAAA,MAAO;AACL,MAAA,OAAOF,GAAA;AACT,IAAA;AACF,EAAA;EAEA,IAAIG,QAAAA,GAAoB;IACtB,OAAO,IAAI,CAACP,MAAM,CAACQ,gBAAgB,KAAK,IAAI,CAACX,SAAS;AACxD,EAAA;EAGAY,QAAAA,CAASC,KAAiB,EAAQ;AAChC,IAAA,IAAIA,KAAA,CAAMC,OAAO,IAAID,KAAA,CAAME,OAAO,EAAE;AAClC,MAAA;AACF,IAAA;IAEA,IAAI,IAAI,CAACf,SAAS,IAAI,CAAC,IAAI,CAACE,IAAI,CAACO,MAAM,EAAE;MACvCI,KAAA,CAAMG,cAAc,EAAA;MACpB,IAAI,CAACb,MAAM,CAACc,YAAY,CAAC,IAAI,CAACjB,SAAS,CAAA;AACzC,IAAA;AACF,EAAA;AAAA,EAAA;IAAAkB,CAAA,CAAA,IAAA,CAAArB,SAAA,EAAA,UAAA,EAAA,CAVCsB,MAAA,CAAA,CAAA;AAAA;AAYD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,4PAAA,EAaA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
@@ -1,4 +1,3 @@
1
-
2
1
  import Component from '@glimmer/component';
3
2
  import { service } from '@ember/service';
4
3
  import { precompileTemplate } from '@ember/template-compilation';
@@ -1 +1 @@
1
- {"version":3,"file":"docfy-output.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"docfy-output.js","sources":["../../src/components/docfy-output.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { service } from '@ember/service';\nimport type RouterService from '@ember/routing/router-service';\n\nimport type DocfyService from '../services/docfy';\nimport type { NestedPageMetadata, PageMetadata } from '@docfy/core/lib/types';\n\ninterface DocfyOutputSignature {\n Args: {\n type?: 'flat' | 'nested';\n fromCurrentURL?: boolean;\n url?: string;\n scope?: string;\n };\n Blocks: {\n default: [\n output: NestedPageMetadata | PageMetadata[] | PageMetadata | undefined,\n ];\n };\n}\n\nexport default class DocfyOutput extends Component<DocfyOutputSignature> {\n @service('router') declare router: RouterService;\n @service('docfy') declare docfy: DocfyService;\n\n get output(): NestedPageMetadata | PageMetadata[] | PageMetadata | undefined {\n if (this.args.url) {\n return this.docfy.findByUrl(this.args.url, this.args.scope);\n }\n\n if (this.args.fromCurrentURL) {\n const currentURL = this.router.currentURL;\n if (!currentURL) return undefined;\n return this.docfy.findByUrl(currentURL, this.args.scope);\n }\n\n if (this.args.scope) {\n return this.docfy.findNestedChildrenByName(this.args.scope);\n }\n\n if (this.args.type === 'flat') {\n return this.docfy.flat;\n } else {\n return this.docfy.nested;\n }\n }\n\n <template>{{yield this.output}}</template>\n}\n"],"names":["DocfyOutput","Component","g","prototype","service","i","output","args","url","docfy","findByUrl","scope","fromCurrentURL","currentURL","router","undefined","findNestedChildrenByName","type","flat","nested","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;;AAqBe,MAAMA,oBAAoBC,SAAA,CAAU;AAAA,EAAA;AAAAC,IAAAA,CAAA,MAAAC,SAAA,EAAA,QAAA,EAAA,CAChDC,OAAA,CAAQ,QAAA,CAAA,CAAA,CAAA;AAAA;EAAA,OAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,QAAA,CAAA,EAAA,MAAA;AAAA,EAAA;AAAAH,IAAAA,CAAA,MAAAC,SAAA,EAAA,OAAA,EAAA,CACRC,OAAA,CAAQ,OAAA,CAAA,CAAA,CAAA;AAAA;EAAA,MAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,OAAA,CAAA,EAAA,MAAA;EAET,IAAIC,MAAAA,GAAyE;AAC3E,IAAA,IAAI,IAAI,CAACC,IAAI,CAACC,GAAG,EAAE;AACjB,MAAA,OAAO,IAAI,CAACC,KAAK,CAACC,SAAS,CAAC,IAAI,CAACH,IAAI,CAACC,GAAG,EAAE,IAAI,CAACD,IAAI,CAACI,KAAK,CAAA;AAC5D,IAAA;AAEA,IAAA,IAAI,IAAI,CAACJ,IAAI,CAACK,cAAc,EAAE;AAC5B,MAAA,MAAMC,UAAA,GAAa,IAAI,CAACC,MAAM,CAACD,UAAU;AACzC,MAAA,IAAI,CAACA,YAAY,OAAOE,SAAA;AACxB,MAAA,OAAO,IAAI,CAACN,KAAK,CAACC,SAAS,CAACG,UAAA,EAAY,IAAI,CAACN,IAAI,CAACI,KAAK,CAAA;AACzD,IAAA;AAEA,IAAA,IAAI,IAAI,CAACJ,IAAI,CAACI,KAAK,EAAE;MACnB,OAAO,IAAI,CAACF,KAAK,CAACO,wBAAwB,CAAC,IAAI,CAACT,IAAI,CAACI,KAAK,CAAA;AAC5D,IAAA;AAEA,IAAA,IAAI,IAAI,CAACJ,IAAI,CAACU,IAAI,KAAK,MAAA,EAAQ;AAC7B,MAAA,OAAO,IAAI,CAACR,KAAK,CAACS,IAAI;AACxB,IAAA,CAAA,MAAO;AACL,MAAA,OAAO,IAAI,CAACT,KAAK,CAACU,MAAM;AAC1B,IAAA;AACF,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,uBAAA,EAA+B;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AAC3C;;;;"}
@@ -1,4 +1,3 @@
1
-
2
1
  import Component from '@glimmer/component';
3
2
  import { service } from '@ember/service';
4
3
  import { precompileTemplate } from '@ember/template-compilation';
@@ -1 +1 @@
1
- {"version":3,"file":"docfy-previous-and-next-page.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"docfy-previous-and-next-page.js","sources":["../../src/components/docfy-previous-and-next-page.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { service } from '@ember/service';\nimport type DocfyService from '../services/docfy';\nimport type { PageMetadata } from '@docfy/core/lib/types';\n\ninterface DocfyPreviousAndNextPageArgs {\n scope?: string;\n}\n\ninterface DocfyPreviousAndNextPageSignature {\n Args: DocfyPreviousAndNextPageArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [\n previous: PageMetadata | undefined,\n next: PageMetadata | undefined,\n ];\n };\n}\n\nexport default class DocfyPreviousAndNextPage extends Component<DocfyPreviousAndNextPageSignature> {\n @service('docfy') declare docfy: DocfyService;\n\n get previous(): PageMetadata | undefined {\n return this.docfy.previousPage(this.args.scope);\n }\n\n get next(): PageMetadata | undefined {\n return this.docfy.nextPage(this.args.scope);\n }\n\n <template>{{yield this.previous this.next}}</template>\n}\n"],"names":["DocfyPreviousAndNextPage","Component","g","prototype","service","i","previous","docfy","previousPage","args","scope","next","nextPage","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;;AAoBe,MAAMA,iCAAiCC,SAAA,CAAU;AAAA,EAAA;AAAAC,IAAAA,CAAA,MAAAC,SAAA,EAAA,OAAA,EAAA,CAC7DC,OAAA,CAAQ,OAAA,CAAA,CAAA,CAAA;AAAA;EAAA,MAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,OAAA,CAAA,EAAA,MAAA;EAET,IAAIC,QAAAA,GAAqC;IACvC,OAAO,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,IAAI,CAACC,IAAI,CAACC,KAAK,CAAA;AAChD,EAAA;EAEA,IAAIC,IAAAA,GAAiC;IACnC,OAAO,IAAI,CAACJ,KAAK,CAACK,QAAQ,CAAC,IAAI,CAACH,IAAI,CAACC,KAAK,CAAA;AAC5C,EAAA;AAEA,EAAA;IAAAG,oBAAA,CAAAC,kBAAA,CAAA,mCAAA,EAA2C;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACvD;;;;"}
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  export { default as DocfyDemo } from './components/docfy-demo.js';
3
2
  export { default as DocfyLink } from './components/docfy-link.js';
4
3
  export { default as DocfyOutput } from './components/docfy-output.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
package/dist/routing.js CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  import output from '@docfy/ember/output:virtual';
3
2
 
4
3
  function addFromNested(context, nested) {
@@ -1 +1 @@
1
- {"version":3,"file":"routing.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"routing.js","sources":["../src/routing.ts"],"sourcesContent":["import output from '@docfy/ember/output:virtual';\nimport type { NestedPageMetadata } from '@docfy/core/lib/types';\n\ninterface RouterDSL {\n route(name: string, callback?: () => void): void;\n}\n\nfunction addFromNested(context: RouterDSL, nested: NestedPageMetadata): void {\n function add(this: RouterDSL): void {\n nested.pages.forEach((page) => {\n const url = page.relativeUrl;\n if (typeof url === 'string') {\n if (url !== '') {\n this.route(url);\n }\n }\n });\n\n nested.children.forEach((node) => {\n addFromNested(this, node);\n });\n }\n\n if (nested.name === '/') {\n add.call(context);\n } else {\n context.route(nested.name, add);\n }\n}\n\nexport function addDocfyRoutes(context: RouterDSL): void {\n addFromNested(context, output.nested);\n}\n"],"names":["addFromNested","context","nested","add","pages","forEach","page","url","relativeUrl","route","children","node","name","call","addDocfyRoutes","output"],"mappings":";;AAOA,SAASA,aAAaA,CAACC,OAAkB,EAAEC,MAA0B,EAAQ;EAC3E,SAASC,GAAGA,GAAwB;AAClCD,IAAAA,MAAM,CAACE,KAAK,CAACC,OAAO,CAAEC,IAAI,IAAK;AAC7B,MAAA,MAAMC,GAAG,GAAGD,IAAI,CAACE,WAAW;AAC5B,MAAA,IAAI,OAAOD,GAAG,KAAK,QAAQ,EAAE;QAC3B,IAAIA,GAAG,KAAK,EAAE,EAAE;AACd,UAAA,IAAI,CAACE,KAAK,CAACF,GAAG,CAAC;AACjB,QAAA;AACF,MAAA;AACF,IAAA,CAAC,CAAC;AAEFL,IAAAA,MAAM,CAACQ,QAAQ,CAACL,OAAO,CAAEM,IAAI,IAAK;AAChCX,MAAAA,aAAa,CAAC,IAAI,EAAEW,IAAI,CAAC;AAC3B,IAAA,CAAC,CAAC;AACJ,EAAA;AAEA,EAAA,IAAIT,MAAM,CAACU,IAAI,KAAK,GAAG,EAAE;AACvBT,IAAAA,GAAG,CAACU,IAAI,CAACZ,OAAO,CAAC;AACnB,EAAA,CAAC,MAAM;IACLA,OAAO,CAACQ,KAAK,CAACP,MAAM,CAACU,IAAI,EAAET,GAAG,CAAC;AACjC,EAAA;AACF;AAEO,SAASW,cAAcA,CAACb,OAAkB,EAAQ;AACvDD,EAAAA,aAAa,CAACC,OAAO,EAAEc,MAAM,CAACb,MAAM,CAAC;AACvC;;;;"}
@@ -1,4 +1,3 @@
1
-
2
1
  import Service, { service } from '@ember/service';
3
2
  import { cached } from '@glimmer/tracking';
4
3
  import output from '@docfy/ember/output:virtual';
@@ -1 +1 @@
1
- {"version":3,"file":"docfy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"docfy.js","sources":["../../src/services/docfy.ts"],"sourcesContent":["import Service from '@ember/service';\nimport { service } from '@ember/service';\nimport { cached } from '@glimmer/tracking';\nimport output from '@docfy/ember/output:virtual';\nimport type RouterService from '@ember/routing/router-service';\nimport type { NestedPageMetadata, PageMetadata } from '@docfy/core/lib/types';\n\nfunction flatNested(\n output?: NestedPageMetadata,\n pages: PageMetadata[] = [],\n): PageMetadata[] {\n if (typeof output === 'undefined') {\n return [];\n }\n\n pages.push(...output.pages);\n\n output.children.forEach((child) => {\n flatNested(child, pages);\n });\n\n return pages;\n}\n\nexport default class DocfyService extends Service {\n @service('router') declare router: RouterService;\n\n @cached\n get currentPage() {\n const currentURL = this.router.currentURL;\n return currentURL ? this.findByUrl(currentURL) : undefined;\n }\n\n get flat(): PageMetadata[] {\n return flatNested(this.nested);\n }\n\n get nested(): NestedPageMetadata {\n return output.nested;\n }\n\n findNestedChildrenByName(\n scope: string,\n previousNested: NestedPageMetadata | undefined | null = null,\n ): NestedPageMetadata | undefined {\n if (previousNested === null) {\n previousNested = this.nested;\n }\n const parts = scope.split('/');\n const name = parts.shift();\n\n const foundScope = previousNested?.children.find((item) => {\n return item.name === name;\n });\n\n if (parts.length > 0) {\n return this.findNestedChildrenByName(parts.join('/'), foundScope);\n }\n\n return foundScope;\n }\n\n findByUrl(url: string, scopeByNestedName?: string): PageMetadata | undefined {\n let pages = this.flat;\n\n if (typeof scopeByNestedName === 'string') {\n pages = flatNested(this.findNestedChildrenByName(scopeByNestedName));\n }\n\n const cleanedUrl = url.split('#')[0] || '';\n const finalUrl = cleanedUrl.replace(/\\/$/, '');\n\n return pages.find((item) => {\n return item.url === finalUrl || item.url === `${finalUrl}/`;\n });\n }\n\n previousPage(scopeByNestedName?: string): PageMetadata | undefined {\n return this.findPreviousOrNextPage(true, scopeByNestedName);\n }\n\n nextPage(scopeByNestedName?: string): PageMetadata | undefined {\n return this.findPreviousOrNextPage(false, scopeByNestedName);\n }\n\n private findPreviousOrNextPage(\n isPrevious: boolean,\n scopeByNestedName?: string,\n ): PageMetadata | undefined {\n const currentPage = this.currentPage;\n let pages = this.flat;\n\n if (typeof scopeByNestedName === 'string') {\n pages = flatNested(this.findNestedChildrenByName(scopeByNestedName));\n }\n\n const index = pages.findIndex((page) => {\n return page === currentPage;\n });\n\n if (index > -1) {\n if (isPrevious) {\n return pages[index - 1];\n } else {\n return pages[index + 1];\n }\n }\n return undefined;\n }\n}\n"],"names":["flatNested","output","pages","push","children","forEach","child","DocfyService","Service","g","prototype","service","i","currentPage","currentURL","router","findByUrl","undefined","n","cached","flat","nested","findNestedChildrenByName","scope","previousNested","parts","split","name","shift","foundScope","find","item","length","join","url","scopeByNestedName","cleanedUrl","finalUrl","replace","previousPage","findPreviousOrNextPage","nextPage","isPrevious","index","findIndex","page"],"mappings":";;;;;AAOA,SAASA,UAAUA,CACjBC,MAA2B,EAC3BC,KAAqB,GAAG,EAAE,EACV;AAChB,EAAA,IAAI,OAAOD,MAAM,KAAK,WAAW,EAAE;AACjC,IAAA,OAAO,EAAE;AACX,EA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AAEQK,EAAAA,sBAAsBA,CAC5BE,UAAmB,EACnBP,iBAA0B,EACA;AAC1B,IAAA,MAAMtB,WAAW,GAAG,IAAI,CAACA,WAAW;AACpC,IAAA,IAAIX,KAAK,GAAG,IAAI,CAACkB,IAAI;AAErB,IAAA,IAAI,OAAOe,iBAAiB,KAAK,QAAQ,EAAE;MACzCjC,KAAK,GAAGF,UAAU,CAAC,IAAI,CAACsB,wBAAwB,CAACa,iBAAiB,CAAC,CAAC;AACtE,IAAA;AAEA,IAAA,MAAMQ,KAAK,GAAGzC,KAAK,CAAC0C,SAAS,CAAEC,IAAI,IAAK;MACtC,OAAOA,IAAI,KAAKhC,WAAW;AAC7B,IAAA,CAAC,CAAC;AAEF,IAAA,IAAI8B,KAAK,GAAG,EAAE,EAAE;AACd,MAAA,IAAID,UAAU,EAAE;AACd,QAAA,OAAOxC,KAAK,CAACyC,KAAK,GAAG,CAAC,CAAC;AACzB,MAAA,CAAC,MAAM;AACL,QAAA,OAAOzC,KAAK,CAACyC,KAAK,GAAG,CAAC,CAAC;AACzB,MAAA;AACF,IAAA;AACA,IAAA,OAAO1B,SAAS;AAClB,EAAA;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docfy/ember",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "The default blueprint for Embroider v2 addons.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -18,8 +18,8 @@
18
18
  "compile": "rollup --config",
19
19
  "format": "prettier . --cache --write",
20
20
  "format:check": "prettier . --cache --check",
21
- "lint": "concurrently \"yarn:lint:js\" \"yarn:lint:hbs\" \"yarn:lint:types\" \"yarn:lint:format\" --names \"lint:\" --prefixColors auto",
22
- "lint:fix": "concurrently \"yarn:lint:*:fix\" --names \"fix:\" --prefixColors auto && yarn format",
21
+ "lint": "concurrently \"pnpm:lint:js\" \"pnpm:lint:hbs\" \"pnpm:lint:types\" \"pnpm:lint:format\" --names \"lint:\" --prefixColors auto",
22
+ "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto && pnpm format",
23
23
  "lint:format": "prettier . --cache --check",
24
24
  "lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
25
25
  "lint:js": "eslint . --cache",
@@ -29,6 +29,7 @@
29
29
  "prepack": "rollup --config"
30
30
  },
31
31
  "dependencies": {
32
+ "@docfy/core": "^0.11.0",
32
33
  "@embroider/addon-shim": "^1.8.9",
33
34
  "@embroider/macros": "^1.18.1",
34
35
  "decorator-transforms": "^2.3.0"
@@ -104,5 +105,5 @@
104
105
  ]
105
106
  }
106
107
  },
107
- "gitHead": "ee9fe9a5fc4d12ae19c5f872883a344d8e8e3a4a"
108
+ "gitHead": "ed6eef49ddb6bfb1ac4c91f94bc4d9291d202130"
108
109
  }
@@ -1,11 +0,0 @@
1
- import type { NestedPageMetadata } from '@docfy/core/lib/types';
2
- /**
3
- * Find a nested section by scope path (e.g., 'docs' or 'docs/category1').
4
- * This is a shared utility used by both the routing module and the DocfyService.
5
- *
6
- * @param scope - The scope path to search for (e.g., 'docs', 'docs/category1/components')
7
- * @param nested - The nested structure to search in
8
- * @returns The found NestedPageMetadata or undefined if not found
9
- */
10
- export declare function findNestedByScope(scope: string, nested: NestedPageMetadata): NestedPageMetadata | undefined;
11
- //# sourceMappingURL=nested.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nested.d.ts","sourceRoot":"","sources":["../../src/utils/nested.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,kBAAkB,GACzB,kBAAkB,GAAG,SAAS,CAqBhC"}
package/dist/output.d.ts DELETED
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=output.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"output.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/output.js DELETED
@@ -1,17 +0,0 @@
1
- /*
2
- * The actual output.js file is generated at build time. This is a temporary
3
- * placeholder to resolve the import until the proper build-time generation
4
- * is set up.
5
- */
6
-
7
- const output = {
8
- nested: {
9
- name: '',
10
- route: '',
11
- pages: [],
12
- children: []
13
- }
14
- };
15
-
16
- export default output;
17
- //# sourceMappingURL=output.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"output.js","sources":["../src/output.d.ts"],"sourcesContent":["/*\n * The actual output.js file is generated at build time. This is only to\n * provide typing.\n */\nimport type { NestedPageMetadata } from '@docfy/core/lib/types';\n\ninterface Output {\n nested: NestedPageMetadata;\n}\n\ndeclare const output: Output;\n\nexport default output;\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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