@jjlmoya/utils-developer 1.28.0 → 1.29.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/package.json +1 -1
- package/src/entries.ts +4 -1
- package/src/tests/i18n_coverage.test.ts +5 -2
- package/src/tests/locale_completeness.test.ts +1 -1
- package/src/tests/qa-test-helpers.ts +32 -0
- package/src/tests/qa_bibliography_links.test.ts +43 -0
- package/src/tests/qa_claim_evidence.test.ts +69 -0
- package/src/tests/qa_logic_reference_coverage.test.ts +46 -0
- package/src/tests/qa_runtime_i18n.test.ts +115 -0
- package/src/tests/tool_validation.test.ts +1 -1
- package/src/tool/aspectRatio/bibliography.astro +2 -10
- package/src/tool/aspectRatio/bibliography.ts +7 -0
- package/src/tool/aspectRatio/i18n/de.ts +2 -14
- package/src/tool/aspectRatio/i18n/en.ts +2 -14
- package/src/tool/aspectRatio/i18n/es.ts +2 -14
- package/src/tool/aspectRatio/i18n/fr.ts +2 -14
- package/src/tool/aspectRatio/i18n/id.ts +2 -14
- package/src/tool/aspectRatio/i18n/it.ts +2 -14
- package/src/tool/aspectRatio/i18n/ja.ts +2 -14
- package/src/tool/aspectRatio/i18n/ko.ts +2 -14
- package/src/tool/aspectRatio/i18n/nl.ts +2 -14
- package/src/tool/aspectRatio/i18n/pl.ts +2 -14
- package/src/tool/aspectRatio/i18n/pt.ts +2 -14
- package/src/tool/aspectRatio/i18n/ru.ts +2 -14
- package/src/tool/aspectRatio/i18n/sv.ts +2 -14
- package/src/tool/aspectRatio/i18n/tr.ts +2 -14
- package/src/tool/aspectRatio/i18n/zh.ts +2 -14
- package/src/tool/calculadoraTiempoDatos/bibliography.astro +2 -10
- package/src/tool/calculadoraTiempoDatos/bibliography.ts +8 -0
- package/src/tool/calculadoraTiempoDatos/component.astro +6 -2
- package/src/tool/calculadoraTiempoDatos/i18n/de.ts +2 -6
- package/src/tool/calculadoraTiempoDatos/i18n/en.ts +2 -6
- package/src/tool/calculadoraTiempoDatos/i18n/es.ts +2 -6
- package/src/tool/calculadoraTiempoDatos/i18n/fr.ts +2 -6
- package/src/tool/calculadoraTiempoDatos/i18n/id.ts +2 -6
- package/src/tool/calculadoraTiempoDatos/i18n/it.ts +2 -6
- package/src/tool/calculadoraTiempoDatos/i18n/ja.ts +2 -6
- package/src/tool/calculadoraTiempoDatos/i18n/ko.ts +2 -6
- package/src/tool/calculadoraTiempoDatos/i18n/nl.ts +2 -6
- package/src/tool/calculadoraTiempoDatos/i18n/pl.ts +2 -6
- package/src/tool/calculadoraTiempoDatos/i18n/pt.ts +2 -6
- package/src/tool/calculadoraTiempoDatos/i18n/ru.ts +2 -6
- package/src/tool/calculadoraTiempoDatos/i18n/sv.ts +2 -6
- package/src/tool/calculadoraTiempoDatos/i18n/tr.ts +2 -6
- package/src/tool/calculadoraTiempoDatos/i18n/zh.ts +2 -6
- package/src/tool/colorConverter/bibliography.astro +2 -10
- package/src/tool/colorConverter/bibliography.ts +7 -0
- package/src/tool/colorConverter/i18n/de.ts +2 -5
- package/src/tool/colorConverter/i18n/en.ts +5 -8
- package/src/tool/colorConverter/i18n/es.ts +4 -7
- package/src/tool/colorConverter/i18n/fr.ts +2 -5
- package/src/tool/colorConverter/i18n/id.ts +2 -5
- package/src/tool/colorConverter/i18n/it.ts +2 -5
- package/src/tool/colorConverter/i18n/ja.ts +2 -5
- package/src/tool/colorConverter/i18n/ko.ts +2 -5
- package/src/tool/colorConverter/i18n/nl.ts +2 -5
- package/src/tool/colorConverter/i18n/pl.ts +2 -5
- package/src/tool/colorConverter/i18n/pt.ts +2 -5
- package/src/tool/colorConverter/i18n/ru.ts +2 -5
- package/src/tool/colorConverter/i18n/sv.ts +2 -5
- package/src/tool/colorConverter/i18n/tr.ts +2 -5
- package/src/tool/colorConverter/i18n/zh.ts +2 -5
- package/src/tool/conversorExcelCsvHtml/bibliography.astro +2 -10
- package/src/tool/conversorExcelCsvHtml/bibliography.ts +8 -0
- package/src/tool/conversorExcelCsvHtml/component.astro +4 -3
- package/src/tool/conversorExcelCsvHtml/i18n/de.ts +2 -6
- package/src/tool/conversorExcelCsvHtml/i18n/en.ts +2 -6
- package/src/tool/conversorExcelCsvHtml/i18n/es.ts +2 -6
- package/src/tool/conversorExcelCsvHtml/i18n/fr.ts +2 -6
- package/src/tool/conversorExcelCsvHtml/i18n/id.ts +2 -6
- package/src/tool/conversorExcelCsvHtml/i18n/it.ts +2 -6
- package/src/tool/conversorExcelCsvHtml/i18n/ja.ts +2 -6
- package/src/tool/conversorExcelCsvHtml/i18n/ko.ts +2 -6
- package/src/tool/conversorExcelCsvHtml/i18n/nl.ts +2 -6
- package/src/tool/conversorExcelCsvHtml/i18n/pl.ts +2 -6
- package/src/tool/conversorExcelCsvHtml/i18n/pt.ts +2 -6
- package/src/tool/conversorExcelCsvHtml/i18n/ru.ts +2 -6
- package/src/tool/conversorExcelCsvHtml/i18n/sv.ts +2 -6
- package/src/tool/conversorExcelCsvHtml/i18n/tr.ts +2 -6
- package/src/tool/conversorExcelCsvHtml/i18n/zh.ts +2 -6
- package/src/tool/cronGenerator/bibliography.astro +2 -10
- package/src/tool/cronGenerator/bibliography.ts +6 -0
- package/src/tool/cronGenerator/component.astro +5 -1
- package/src/tool/cronGenerator/i18n/de.ts +2 -10
- package/src/tool/cronGenerator/i18n/en.ts +2 -10
- package/src/tool/cronGenerator/i18n/es.ts +2 -10
- package/src/tool/cronGenerator/i18n/fr.ts +2 -10
- package/src/tool/cronGenerator/i18n/id.ts +2 -10
- package/src/tool/cronGenerator/i18n/it.ts +2 -10
- package/src/tool/cronGenerator/i18n/ja.ts +2 -10
- package/src/tool/cronGenerator/i18n/ko.ts +2 -10
- package/src/tool/cronGenerator/i18n/nl.ts +2 -10
- package/src/tool/cronGenerator/i18n/pl.ts +2 -10
- package/src/tool/cronGenerator/i18n/pt.ts +2 -10
- package/src/tool/cronGenerator/i18n/ru.ts +2 -10
- package/src/tool/cronGenerator/i18n/sv.ts +2 -10
- package/src/tool/cronGenerator/i18n/tr.ts +2 -10
- package/src/tool/cronGenerator/i18n/zh.ts +2 -10
- package/src/tool/cssBoxShadowGenerator/component.astro +2 -1
- package/src/tool/cssBoxShadowGenerator/logic.test.ts +28 -0
- package/src/tool/cssSpecificityCalculator/bibliography.astro +2 -10
- package/src/tool/cssSpecificityCalculator/bibliography.ts +6 -0
- package/src/tool/cssSpecificityCalculator/i18n/de.ts +2 -10
- package/src/tool/cssSpecificityCalculator/i18n/en.ts +2 -10
- package/src/tool/cssSpecificityCalculator/i18n/es.ts +2 -10
- package/src/tool/cssSpecificityCalculator/i18n/fr.ts +2 -10
- package/src/tool/cssSpecificityCalculator/i18n/id.ts +2 -10
- package/src/tool/cssSpecificityCalculator/i18n/it.ts +2 -10
- package/src/tool/cssSpecificityCalculator/i18n/ja.ts +2 -10
- package/src/tool/cssSpecificityCalculator/i18n/ko.ts +2 -10
- package/src/tool/cssSpecificityCalculator/i18n/nl.ts +2 -10
- package/src/tool/cssSpecificityCalculator/i18n/pl.ts +2 -10
- package/src/tool/cssSpecificityCalculator/i18n/pt.ts +2 -10
- package/src/tool/cssSpecificityCalculator/i18n/ru.ts +2 -10
- package/src/tool/cssSpecificityCalculator/i18n/sv.ts +2 -10
- package/src/tool/cssSpecificityCalculator/i18n/tr.ts +2 -10
- package/src/tool/cssSpecificityCalculator/i18n/zh.ts +2 -10
- package/src/tool/cssToInlineConverter/bibliography.astro +2 -10
- package/src/tool/cssToInlineConverter/bibliography.ts +7 -0
- package/src/tool/cssToInlineConverter/i18n/de.ts +2 -14
- package/src/tool/cssToInlineConverter/i18n/en.ts +4 -16
- package/src/tool/cssToInlineConverter/i18n/es.ts +5 -17
- package/src/tool/cssToInlineConverter/i18n/fr.ts +2 -14
- package/src/tool/cssToInlineConverter/i18n/id.ts +2 -14
- package/src/tool/cssToInlineConverter/i18n/it.ts +2 -14
- package/src/tool/cssToInlineConverter/i18n/ja.ts +2 -14
- package/src/tool/cssToInlineConverter/i18n/ko.ts +2 -14
- package/src/tool/cssToInlineConverter/i18n/nl.ts +2 -14
- package/src/tool/cssToInlineConverter/i18n/pl.ts +2 -14
- package/src/tool/cssToInlineConverter/i18n/pt.ts +2 -14
- package/src/tool/cssToInlineConverter/i18n/ru.ts +2 -14
- package/src/tool/cssToInlineConverter/i18n/sv.ts +2 -14
- package/src/tool/cssToInlineConverter/i18n/tr.ts +2 -14
- package/src/tool/cssToInlineConverter/i18n/zh.ts +2 -14
- package/src/tool/duplicateCssRemover/bibliography.astro +2 -10
- package/src/tool/duplicateCssRemover/bibliography.ts +7 -0
- package/src/tool/duplicateCssRemover/i18n/de.ts +2 -14
- package/src/tool/duplicateCssRemover/i18n/en.ts +4 -16
- package/src/tool/duplicateCssRemover/i18n/es.ts +4 -16
- package/src/tool/duplicateCssRemover/i18n/fr.ts +2 -14
- package/src/tool/duplicateCssRemover/i18n/id.ts +2 -14
- package/src/tool/duplicateCssRemover/i18n/it.ts +2 -14
- package/src/tool/duplicateCssRemover/i18n/ja.ts +2 -14
- package/src/tool/duplicateCssRemover/i18n/ko.ts +2 -14
- package/src/tool/duplicateCssRemover/i18n/nl.ts +2 -14
- package/src/tool/duplicateCssRemover/i18n/pl.ts +2 -14
- package/src/tool/duplicateCssRemover/i18n/pt.ts +2 -14
- package/src/tool/duplicateCssRemover/i18n/ru.ts +2 -14
- package/src/tool/duplicateCssRemover/i18n/sv.ts +2 -14
- package/src/tool/duplicateCssRemover/i18n/tr.ts +2 -14
- package/src/tool/duplicateCssRemover/i18n/zh.ts +2 -14
- package/src/tool/generadorSecurityTxt/bibliography.astro +2 -10
- package/src/tool/generadorSecurityTxt/bibliography.ts +7 -0
- package/src/tool/generadorSecurityTxt/component.astro +1 -2
- package/src/tool/generadorSecurityTxt/i18n/de.ts +2 -5
- package/src/tool/generadorSecurityTxt/i18n/en.ts +2 -5
- package/src/tool/generadorSecurityTxt/i18n/es.ts +2 -5
- package/src/tool/generadorSecurityTxt/i18n/fr.ts +2 -5
- package/src/tool/generadorSecurityTxt/i18n/id.ts +2 -5
- package/src/tool/generadorSecurityTxt/i18n/it.ts +2 -5
- package/src/tool/generadorSecurityTxt/i18n/ja.ts +2 -5
- package/src/tool/generadorSecurityTxt/i18n/ko.ts +2 -5
- package/src/tool/generadorSecurityTxt/i18n/nl.ts +2 -5
- package/src/tool/generadorSecurityTxt/i18n/pl.ts +2 -5
- package/src/tool/generadorSecurityTxt/i18n/pt.ts +2 -5
- package/src/tool/generadorSecurityTxt/i18n/ru.ts +2 -5
- package/src/tool/generadorSecurityTxt/i18n/sv.ts +2 -5
- package/src/tool/generadorSecurityTxt/i18n/tr.ts +2 -5
- package/src/tool/generadorSecurityTxt/i18n/zh.ts +2 -5
- package/src/tool/hashGenerator/bibliography.astro +2 -10
- package/src/tool/hashGenerator/bibliography.ts +7 -0
- package/src/tool/hashGenerator/i18n/de.ts +2 -5
- package/src/tool/hashGenerator/i18n/en.ts +2 -5
- package/src/tool/hashGenerator/i18n/es.ts +2 -5
- package/src/tool/hashGenerator/i18n/fr.ts +2 -5
- package/src/tool/hashGenerator/i18n/id.ts +2 -5
- package/src/tool/hashGenerator/i18n/it.ts +2 -5
- package/src/tool/hashGenerator/i18n/ja.ts +2 -5
- package/src/tool/hashGenerator/i18n/ko.ts +2 -5
- package/src/tool/hashGenerator/i18n/nl.ts +2 -5
- package/src/tool/hashGenerator/i18n/pl.ts +2 -5
- package/src/tool/hashGenerator/i18n/pt.ts +2 -5
- package/src/tool/hashGenerator/i18n/ru.ts +2 -5
- package/src/tool/hashGenerator/i18n/sv.ts +2 -5
- package/src/tool/hashGenerator/i18n/tr.ts +2 -5
- package/src/tool/hashGenerator/i18n/zh.ts +2 -5
- package/src/tool/inspectorCertificadosSsl/bibliography.astro +2 -10
- package/src/tool/inspectorCertificadosSsl/bibliography.ts +8 -0
- package/src/tool/inspectorCertificadosSsl/component.astro +4 -3
- package/src/tool/inspectorCertificadosSsl/i18n/de.ts +2 -6
- package/src/tool/inspectorCertificadosSsl/i18n/en.ts +2 -6
- package/src/tool/inspectorCertificadosSsl/i18n/es.ts +2 -6
- package/src/tool/inspectorCertificadosSsl/i18n/fr.ts +2 -6
- package/src/tool/inspectorCertificadosSsl/i18n/id.ts +2 -6
- package/src/tool/inspectorCertificadosSsl/i18n/it.ts +2 -6
- package/src/tool/inspectorCertificadosSsl/i18n/ja.ts +2 -6
- package/src/tool/inspectorCertificadosSsl/i18n/ko.ts +2 -6
- package/src/tool/inspectorCertificadosSsl/i18n/nl.ts +2 -6
- package/src/tool/inspectorCertificadosSsl/i18n/pl.ts +2 -6
- package/src/tool/inspectorCertificadosSsl/i18n/pt.ts +2 -6
- package/src/tool/inspectorCertificadosSsl/i18n/ru.ts +2 -6
- package/src/tool/inspectorCertificadosSsl/i18n/sv.ts +2 -6
- package/src/tool/inspectorCertificadosSsl/i18n/tr.ts +2 -6
- package/src/tool/inspectorCertificadosSsl/i18n/zh.ts +2 -6
- package/src/tool/jsonFormatter/bibliography.astro +2 -10
- package/src/tool/jsonFormatter/bibliography.ts +8 -0
- package/src/tool/jsonFormatter/i18n/de.ts +2 -18
- package/src/tool/jsonFormatter/i18n/en.ts +2 -18
- package/src/tool/jsonFormatter/i18n/es.ts +2 -18
- package/src/tool/jsonFormatter/i18n/fr.ts +2 -18
- package/src/tool/jsonFormatter/i18n/id.ts +2 -18
- package/src/tool/jsonFormatter/i18n/it.ts +2 -18
- package/src/tool/jsonFormatter/i18n/ja.ts +2 -18
- package/src/tool/jsonFormatter/i18n/ko.ts +2 -18
- package/src/tool/jsonFormatter/i18n/nl.ts +2 -18
- package/src/tool/jsonFormatter/i18n/pl.ts +2 -18
- package/src/tool/jsonFormatter/i18n/pt.ts +2 -18
- package/src/tool/jsonFormatter/i18n/ru.ts +2 -18
- package/src/tool/jsonFormatter/i18n/sv.ts +2 -18
- package/src/tool/jsonFormatter/i18n/tr.ts +2 -18
- package/src/tool/jsonFormatter/i18n/zh.ts +2 -18
- package/src/tool/jwtDecoder/component.astro +2 -1
- package/src/tool/jwtDecoder/logic.test.ts +32 -0
- package/src/tool/keycode/bibliography.astro +2 -10
- package/src/tool/keycode/bibliography.ts +7 -0
- package/src/tool/keycode/i18n/de.ts +2 -14
- package/src/tool/keycode/i18n/en.ts +2 -14
- package/src/tool/keycode/i18n/es.ts +2 -14
- package/src/tool/keycode/i18n/fr.ts +2 -14
- package/src/tool/keycode/i18n/id.ts +2 -14
- package/src/tool/keycode/i18n/it.ts +2 -14
- package/src/tool/keycode/i18n/ja.ts +2 -14
- package/src/tool/keycode/i18n/ko.ts +2 -14
- package/src/tool/keycode/i18n/nl.ts +2 -14
- package/src/tool/keycode/i18n/pl.ts +2 -14
- package/src/tool/keycode/i18n/pt.ts +2 -14
- package/src/tool/keycode/i18n/ru.ts +2 -14
- package/src/tool/keycode/i18n/sv.ts +2 -14
- package/src/tool/keycode/i18n/tr.ts +2 -14
- package/src/tool/keycode/i18n/zh.ts +2 -14
- package/src/tool/llmCostCalculator/bibliography.astro +2 -10
- package/src/tool/llmCostCalculator/bibliography.ts +8 -0
- package/src/tool/llmCostCalculator/i18n/de.ts +2 -18
- package/src/tool/llmCostCalculator/i18n/en.ts +2 -18
- package/src/tool/llmCostCalculator/i18n/es.ts +2 -18
- package/src/tool/llmCostCalculator/i18n/fr.ts +2 -18
- package/src/tool/llmCostCalculator/i18n/id.ts +2 -18
- package/src/tool/llmCostCalculator/i18n/it.ts +2 -18
- package/src/tool/llmCostCalculator/i18n/ja.ts +2 -18
- package/src/tool/llmCostCalculator/i18n/ko.ts +2 -18
- package/src/tool/llmCostCalculator/i18n/nl.ts +2 -18
- package/src/tool/llmCostCalculator/i18n/pl.ts +2 -18
- package/src/tool/llmCostCalculator/i18n/pt.ts +2 -18
- package/src/tool/llmCostCalculator/i18n/ru.ts +2 -18
- package/src/tool/llmCostCalculator/i18n/sv.ts +2 -18
- package/src/tool/llmCostCalculator/i18n/tr.ts +2 -18
- package/src/tool/llmCostCalculator/i18n/zh.ts +2 -18
- package/src/tool/mobileMockupGenerator/bibliography.astro +2 -10
- package/src/tool/mobileMockupGenerator/bibliography.ts +6 -0
- package/src/tool/mobileMockupGenerator/i18n/de.ts +2 -4
- package/src/tool/mobileMockupGenerator/i18n/en.ts +2 -4
- package/src/tool/mobileMockupGenerator/i18n/es.ts +2 -4
- package/src/tool/mobileMockupGenerator/i18n/fr.ts +2 -4
- package/src/tool/mobileMockupGenerator/i18n/id.ts +2 -4
- package/src/tool/mobileMockupGenerator/i18n/it.ts +2 -4
- package/src/tool/mobileMockupGenerator/i18n/ja.ts +2 -4
- package/src/tool/mobileMockupGenerator/i18n/ko.ts +2 -4
- package/src/tool/mobileMockupGenerator/i18n/nl.ts +2 -4
- package/src/tool/mobileMockupGenerator/i18n/pl.ts +2 -1
- package/src/tool/mobileMockupGenerator/i18n/pt.ts +2 -4
- package/src/tool/mobileMockupGenerator/i18n/ru.ts +2 -4
- package/src/tool/mobileMockupGenerator/i18n/sv.ts +2 -4
- package/src/tool/mobileMockupGenerator/i18n/tr.ts +2 -4
- package/src/tool/mobileMockupGenerator/i18n/zh.ts +2 -4
- package/src/tool/musicalTypography/bibliography.astro +2 -10
- package/src/tool/musicalTypography/bibliography.ts +7 -0
- package/src/tool/musicalTypography/i18n/de.ts +2 -14
- package/src/tool/musicalTypography/i18n/en.ts +3 -15
- package/src/tool/musicalTypography/i18n/es.ts +3 -15
- package/src/tool/musicalTypography/i18n/fr.ts +2 -14
- package/src/tool/musicalTypography/i18n/id.ts +2 -14
- package/src/tool/musicalTypography/i18n/it.ts +2 -14
- package/src/tool/musicalTypography/i18n/ja.ts +2 -14
- package/src/tool/musicalTypography/i18n/ko.ts +2 -14
- package/src/tool/musicalTypography/i18n/nl.ts +2 -14
- package/src/tool/musicalTypography/i18n/pl.ts +2 -14
- package/src/tool/musicalTypography/i18n/pt.ts +2 -5
- package/src/tool/musicalTypography/i18n/ru.ts +2 -5
- package/src/tool/musicalTypography/i18n/sv.ts +2 -1
- package/src/tool/musicalTypography/i18n/tr.ts +2 -1
- package/src/tool/musicalTypography/i18n/zh.ts +2 -1
- package/src/tool/placeholderGenerator/bibliography.astro +2 -10
- package/src/tool/placeholderGenerator/bibliography.ts +7 -0
- package/src/tool/placeholderGenerator/i18n/de.ts +2 -14
- package/src/tool/placeholderGenerator/i18n/en.ts +4 -16
- package/src/tool/placeholderGenerator/i18n/es.ts +4 -16
- package/src/tool/placeholderGenerator/i18n/fr.ts +2 -14
- package/src/tool/placeholderGenerator/i18n/id.ts +2 -14
- package/src/tool/placeholderGenerator/i18n/it.ts +2 -14
- package/src/tool/placeholderGenerator/i18n/ja.ts +2 -14
- package/src/tool/placeholderGenerator/i18n/ko.ts +2 -14
- package/src/tool/placeholderGenerator/i18n/nl.ts +2 -14
- package/src/tool/placeholderGenerator/i18n/pl.ts +2 -14
- package/src/tool/placeholderGenerator/i18n/pt.ts +2 -14
- package/src/tool/placeholderGenerator/i18n/ru.ts +2 -14
- package/src/tool/placeholderGenerator/i18n/sv.ts +2 -14
- package/src/tool/placeholderGenerator/i18n/tr.ts +2 -14
- package/src/tool/placeholderGenerator/i18n/zh.ts +2 -14
- package/src/tool/promoteThisWebsite/asset-bindings.ts +73 -0
- package/src/tool/promoteThisWebsite/bibliography.astro +14 -0
- package/src/tool/promoteThisWebsite/bibliography.ts +14 -0
- package/src/tool/promoteThisWebsite/component.astro +136 -0
- package/src/tool/promoteThisWebsite/control-views.ts +83 -0
- package/src/tool/promoteThisWebsite/controller.ts +232 -0
- package/src/tool/promoteThisWebsite/dom-views.ts +322 -0
- package/src/tool/promoteThisWebsite/entry.ts +15 -0
- package/src/tool/promoteThisWebsite/evaluator.ts +9 -0
- package/src/tool/promoteThisWebsite/i18n/en.ts +111 -0
- package/src/tool/promoteThisWebsite/index.ts +11 -0
- package/src/tool/promoteThisWebsite/jjlmoya-overlay.png +0 -0
- package/src/tool/promoteThisWebsite/logic.test.ts +29 -0
- package/src/tool/promoteThisWebsite/logic.ts +108 -0
- package/src/tool/promoteThisWebsite/pixel-cat.png +0 -0
- package/src/tool/promoteThisWebsite/promote-this-website.css +322 -0
- package/src/tool/promoteThisWebsite/seo.astro +15 -0
- package/src/tool/promoteThisWebsite/storage.ts +28 -0
- package/src/tool/promoteThisWebsite/title-view.ts +206 -0
- package/src/tool/promoteThisWebsite/ui.ts +59 -0
- package/src/tool/promptLibrary/bibliography.astro +2 -10
- package/src/tool/promptLibrary/bibliography.ts +6 -0
- package/src/tool/promptLibrary/i18n/de.ts +2 -4
- package/src/tool/promptLibrary/i18n/en.ts +2 -4
- package/src/tool/promptLibrary/i18n/es.ts +2 -4
- package/src/tool/promptLibrary/i18n/fr.ts +2 -4
- package/src/tool/promptLibrary/i18n/id.ts +2 -4
- package/src/tool/promptLibrary/i18n/it.ts +2 -4
- package/src/tool/promptLibrary/i18n/ja.ts +2 -4
- package/src/tool/promptLibrary/i18n/ko.ts +2 -4
- package/src/tool/promptLibrary/i18n/nl.ts +2 -4
- package/src/tool/promptLibrary/i18n/pl.ts +2 -1
- package/src/tool/promptLibrary/i18n/pt.ts +2 -4
- package/src/tool/promptLibrary/i18n/ru.ts +2 -4
- package/src/tool/promptLibrary/i18n/sv.ts +2 -4
- package/src/tool/promptLibrary/i18n/tr.ts +2 -4
- package/src/tool/promptLibrary/i18n/zh.ts +2 -4
- package/src/tool/readabilityCalculator/bibliography.astro +2 -10
- package/src/tool/readabilityCalculator/bibliography.ts +7 -0
- package/src/tool/readabilityCalculator/i18n/de.ts +2 -5
- package/src/tool/readabilityCalculator/i18n/en.ts +2 -5
- package/src/tool/readabilityCalculator/i18n/es.ts +2 -5
- package/src/tool/readabilityCalculator/i18n/fr.ts +2 -5
- package/src/tool/readabilityCalculator/i18n/id.ts +2 -5
- package/src/tool/readabilityCalculator/i18n/it.ts +2 -5
- package/src/tool/readabilityCalculator/i18n/ja.ts +2 -5
- package/src/tool/readabilityCalculator/i18n/ko.ts +2 -5
- package/src/tool/readabilityCalculator/i18n/nl.ts +2 -5
- package/src/tool/readabilityCalculator/i18n/pl.ts +2 -1
- package/src/tool/readabilityCalculator/i18n/pt.ts +2 -5
- package/src/tool/readabilityCalculator/i18n/ru.ts +2 -5
- package/src/tool/readabilityCalculator/i18n/sv.ts +2 -5
- package/src/tool/readabilityCalculator/i18n/tr.ts +2 -5
- package/src/tool/readabilityCalculator/i18n/zh.ts +2 -5
- package/src/tool/serpPixelSimulator/controller.ts +1 -0
- package/src/tool/serpPixelSimulator/i18n/en.ts +2 -2
- package/src/tool/serpPixelSimulator/i18n/es.ts +2 -2
- package/src/tool/serpPixelSimulator/logic.test.ts +25 -0
- package/src/tool/svgSanitizer/bibliography.astro +2 -10
- package/src/tool/svgSanitizer/bibliography.ts +7 -0
- package/src/tool/svgSanitizer/i18n/de.ts +2 -5
- package/src/tool/svgSanitizer/i18n/en.ts +2 -5
- package/src/tool/svgSanitizer/i18n/es.ts +2 -5
- package/src/tool/svgSanitizer/i18n/fr.ts +2 -5
- package/src/tool/svgSanitizer/i18n/id.ts +2 -5
- package/src/tool/svgSanitizer/i18n/it.ts +2 -5
- package/src/tool/svgSanitizer/i18n/ja.ts +2 -5
- package/src/tool/svgSanitizer/i18n/ko.ts +2 -5
- package/src/tool/svgSanitizer/i18n/nl.ts +2 -5
- package/src/tool/svgSanitizer/i18n/pl.ts +2 -5
- package/src/tool/svgSanitizer/i18n/pt.ts +2 -1
- package/src/tool/svgSanitizer/i18n/ru.ts +2 -5
- package/src/tool/svgSanitizer/i18n/sv.ts +2 -5
- package/src/tool/svgSanitizer/i18n/tr.ts +2 -5
- package/src/tool/svgSanitizer/i18n/zh.ts +2 -5
- package/src/tool/svgToCss/bibliography.astro +2 -10
- package/src/tool/svgToCss/bibliography.ts +8 -0
- package/src/tool/svgToCss/i18n/de.ts +2 -18
- package/src/tool/svgToCss/i18n/en.ts +2 -18
- package/src/tool/svgToCss/i18n/es.ts +2 -18
- package/src/tool/svgToCss/i18n/fr.ts +2 -18
- package/src/tool/svgToCss/i18n/id.ts +2 -18
- package/src/tool/svgToCss/i18n/it.ts +2 -18
- package/src/tool/svgToCss/i18n/ja.ts +2 -18
- package/src/tool/svgToCss/i18n/ko.ts +2 -18
- package/src/tool/svgToCss/i18n/nl.ts +2 -18
- package/src/tool/svgToCss/i18n/pl.ts +2 -18
- package/src/tool/svgToCss/i18n/pt.ts +2 -18
- package/src/tool/svgToCss/i18n/ru.ts +2 -18
- package/src/tool/svgToCss/i18n/sv.ts +2 -18
- package/src/tool/svgToCss/i18n/tr.ts +2 -18
- package/src/tool/svgToCss/i18n/zh.ts +2 -18
- package/src/tool/urlCleaner/bibliography.astro +2 -10
- package/src/tool/urlCleaner/bibliography.ts +7 -0
- package/src/tool/urlCleaner/i18n/de.ts +2 -5
- package/src/tool/urlCleaner/i18n/en.ts +2 -5
- package/src/tool/urlCleaner/i18n/es.ts +2 -5
- package/src/tool/urlCleaner/i18n/fr.ts +2 -5
- package/src/tool/urlCleaner/i18n/id.ts +2 -5
- package/src/tool/urlCleaner/i18n/it.ts +2 -5
- package/src/tool/urlCleaner/i18n/ja.ts +2 -5
- package/src/tool/urlCleaner/i18n/ko.ts +2 -5
- package/src/tool/urlCleaner/i18n/nl.ts +2 -5
- package/src/tool/urlCleaner/i18n/pl.ts +2 -1
- package/src/tool/urlCleaner/i18n/pt.ts +2 -5
- package/src/tool/urlCleaner/i18n/ru.ts +2 -5
- package/src/tool/urlCleaner/i18n/sv.ts +2 -5
- package/src/tool/urlCleaner/i18n/tr.ts +2 -5
- package/src/tool/urlCleaner/i18n/zh.ts +2 -5
- package/src/tool/urlEncoderDecoder/bibliography.astro +2 -10
- package/src/tool/urlEncoderDecoder/bibliography.ts +7 -0
- package/src/tool/urlEncoderDecoder/i18n/de.ts +2 -14
- package/src/tool/urlEncoderDecoder/i18n/en.ts +3 -15
- package/src/tool/urlEncoderDecoder/i18n/es.ts +3 -15
- package/src/tool/urlEncoderDecoder/i18n/fr.ts +2 -14
- package/src/tool/urlEncoderDecoder/i18n/id.ts +2 -14
- package/src/tool/urlEncoderDecoder/i18n/it.ts +2 -14
- package/src/tool/urlEncoderDecoder/i18n/ja.ts +2 -14
- package/src/tool/urlEncoderDecoder/i18n/ko.ts +2 -14
- package/src/tool/urlEncoderDecoder/i18n/nl.ts +2 -14
- package/src/tool/urlEncoderDecoder/i18n/pl.ts +2 -14
- package/src/tool/urlEncoderDecoder/i18n/pt.ts +2 -14
- package/src/tool/urlEncoderDecoder/i18n/ru.ts +2 -14
- package/src/tool/urlEncoderDecoder/i18n/sv.ts +2 -14
- package/src/tool/urlEncoderDecoder/i18n/tr.ts +2 -14
- package/src/tool/urlEncoderDecoder/i18n/zh.ts +2 -14
- package/src/tool/utmGenerator/bibliography.astro +2 -10
- package/src/tool/utmGenerator/bibliography.ts +6 -0
- package/src/tool/utmGenerator/i18n/de.ts +2 -4
- package/src/tool/utmGenerator/i18n/en.ts +2 -4
- package/src/tool/utmGenerator/i18n/es.ts +2 -4
- package/src/tool/utmGenerator/i18n/fr.ts +2 -4
- package/src/tool/utmGenerator/i18n/id.ts +2 -4
- package/src/tool/utmGenerator/i18n/it.ts +2 -4
- package/src/tool/utmGenerator/i18n/ja.ts +2 -4
- package/src/tool/utmGenerator/i18n/ko.ts +2 -4
- package/src/tool/utmGenerator/i18n/nl.ts +2 -4
- package/src/tool/utmGenerator/i18n/pl.ts +2 -4
- package/src/tool/utmGenerator/i18n/pt.ts +2 -4
- package/src/tool/utmGenerator/i18n/ru.ts +2 -4
- package/src/tool/utmGenerator/i18n/sv.ts +2 -4
- package/src/tool/utmGenerator/i18n/tr.ts +2 -4
- package/src/tool/utmGenerator/i18n/zh.ts +2 -4
- package/src/tool/visualCssGridFlexboxGenerator/component.astro +1 -0
- package/src/tool/visualCssGridFlexboxGenerator/logic.test.ts +29 -0
- package/src/tool/visualCssGridFlexboxGenerator/workspace.ts +13 -1
- package/src/tools.ts +2 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { bibliography } from '../bibliography';
|
|
1
2
|
import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
|
|
2
3
|
import type { ToolLocaleContent } from '../../../types';
|
|
3
4
|
import type { PlaceholderGeneratorUI } from '../ui';
|
|
@@ -106,20 +107,7 @@ export const content: ToolLocaleContent<PlaceholderGeneratorUI> = {
|
|
|
106
107
|
faqTitle: 'Questions Fréquentes',
|
|
107
108
|
faq: faqData,
|
|
108
109
|
bibliographyTitle: 'Références et Documentation',
|
|
109
|
-
bibliography
|
|
110
|
-
{
|
|
111
|
-
name: 'MDN Web Docs: HTMLCanvasElement.toDataURL()',
|
|
112
|
-
url: 'https://developer.mozilla.org/fr/docs/Web/API/HTMLCanvasElement/toDataURL',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'MDN Web Docs: CanvasRenderingContext2D',
|
|
116
|
-
url: 'https://developer.mozilla.org/fr/docs/Web/API/CanvasRenderingContext2D',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: 'W3C: HTML Canvas 2D Context',
|
|
120
|
-
url: 'https://www.w3.org/TR/2dcontext/',
|
|
121
|
-
},
|
|
122
|
-
],
|
|
110
|
+
bibliography,
|
|
123
111
|
howTo: howToData,
|
|
124
112
|
schemas: [faqSchema, howToSchema, appSchema],
|
|
125
113
|
seo: [
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { bibliography } from '../bibliography';
|
|
1
2
|
import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
|
|
2
3
|
import type { ToolLocaleContent } from '../../../types';
|
|
3
4
|
import type { PlaceholderGeneratorUI } from '../ui';
|
|
@@ -106,20 +107,7 @@ export const content: ToolLocaleContent<PlaceholderGeneratorUI> = {
|
|
|
106
107
|
faqTitle: 'Pertanyaan yang Sering Diajukan',
|
|
107
108
|
faq: faqData,
|
|
108
109
|
bibliographyTitle: 'Referensi dan Dokumentasi',
|
|
109
|
-
bibliography
|
|
110
|
-
{
|
|
111
|
-
name: 'MDN Web Docs: HTMLCanvasElement.toDataURL()',
|
|
112
|
-
url: 'https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'MDN Web Docs: CanvasRenderingContext2D',
|
|
116
|
-
url: 'https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: 'W3C: HTML Canvas 2D Context',
|
|
120
|
-
url: 'https://www.w3.org/TR/2dcontext/',
|
|
121
|
-
},
|
|
122
|
-
],
|
|
110
|
+
bibliography,
|
|
123
111
|
howTo: howToData,
|
|
124
112
|
schemas: [faqSchema, howToSchema, appSchema],
|
|
125
113
|
seo: [
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { bibliography } from '../bibliography';
|
|
1
2
|
import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
|
|
2
3
|
import type { ToolLocaleContent } from '../../../types';
|
|
3
4
|
import type { PlaceholderGeneratorUI } from '../ui';
|
|
@@ -106,20 +107,7 @@ export const content: ToolLocaleContent<PlaceholderGeneratorUI> = {
|
|
|
106
107
|
faqTitle: 'Domande Frequenti',
|
|
107
108
|
faq: faqData,
|
|
108
109
|
bibliographyTitle: 'Riferimenti e Documentazione',
|
|
109
|
-
bibliography
|
|
110
|
-
{
|
|
111
|
-
name: 'MDN Web Docs: HTMLCanvasElement.toDataURL()',
|
|
112
|
-
url: 'https://developer.mozilla.org/it/docs/Web/API/HTMLCanvasElement/toDataURL',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'MDN Web Docs: CanvasRenderingContext2D',
|
|
116
|
-
url: 'https://developer.mozilla.org/it/docs/Web/API/CanvasRenderingContext2D',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: 'W3C: HTML Canvas 2D Context',
|
|
120
|
-
url: 'https://www.w3.org/TR/2dcontext/',
|
|
121
|
-
},
|
|
122
|
-
],
|
|
110
|
+
bibliography,
|
|
123
111
|
howTo: howToData,
|
|
124
112
|
schemas: [faqSchema, howToSchema, appSchema],
|
|
125
113
|
seo: [
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { bibliography } from '../bibliography';
|
|
1
2
|
import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
|
|
2
3
|
import type { ToolLocaleContent } from '../../../types';
|
|
3
4
|
import type { PlaceholderGeneratorUI } from '../ui';
|
|
@@ -106,20 +107,7 @@ export const content: ToolLocaleContent<PlaceholderGeneratorUI> = {
|
|
|
106
107
|
faqTitle: 'よくある質問',
|
|
107
108
|
faq: faqData,
|
|
108
109
|
bibliographyTitle: '参考資料',
|
|
109
|
-
bibliography
|
|
110
|
-
{
|
|
111
|
-
name: 'MDN Web Docs: HTMLCanvasElement.toDataURL()',
|
|
112
|
-
url: 'https://developer.mozilla.org/ja/docs/Web/API/HTMLCanvasElement/toDataURL',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'MDN Web Docs: CanvasRenderingContext2D',
|
|
116
|
-
url: 'https://developer.mozilla.org/ja/docs/Web/API/CanvasRenderingContext2D',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: 'W3C: HTML Canvas 2D Context',
|
|
120
|
-
url: 'https://www.w3.org/TR/2dcontext/',
|
|
121
|
-
},
|
|
122
|
-
],
|
|
110
|
+
bibliography,
|
|
123
111
|
howTo: howToData,
|
|
124
112
|
schemas: [faqSchema, howToSchema, appSchema],
|
|
125
113
|
seo: [
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { bibliography } from '../bibliography';
|
|
1
2
|
import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
|
|
2
3
|
import type { ToolLocaleContent } from '../../../types';
|
|
3
4
|
import type { PlaceholderGeneratorUI } from '../ui';
|
|
@@ -106,20 +107,7 @@ export const content: ToolLocaleContent<PlaceholderGeneratorUI> = {
|
|
|
106
107
|
faqTitle: '자주 묻는 질문',
|
|
107
108
|
faq: faqData,
|
|
108
109
|
bibliographyTitle: '참고 자료 및 문서',
|
|
109
|
-
bibliography
|
|
110
|
-
{
|
|
111
|
-
name: 'MDN Web Docs: HTMLCanvasElement.toDataURL()',
|
|
112
|
-
url: 'https://developer.mozilla.org/ko/docs/Web/API/HTMLCanvasElement/toDataURL',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'MDN Web Docs: CanvasRenderingContext2D',
|
|
116
|
-
url: 'https://developer.mozilla.org/ko/docs/Web/API/CanvasRenderingContext2D',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: 'W3C: HTML Canvas 2D Context',
|
|
120
|
-
url: 'https://www.w3.org/TR/2dcontext/',
|
|
121
|
-
},
|
|
122
|
-
],
|
|
110
|
+
bibliography,
|
|
123
111
|
howTo: howToData,
|
|
124
112
|
schemas: [faqSchema, howToSchema, appSchema],
|
|
125
113
|
seo: [
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { bibliography } from '../bibliography';
|
|
1
2
|
import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
|
|
2
3
|
import type { ToolLocaleContent } from '../../../types';
|
|
3
4
|
import type { PlaceholderGeneratorUI } from '../ui';
|
|
@@ -106,20 +107,7 @@ export const content: ToolLocaleContent<PlaceholderGeneratorUI> = {
|
|
|
106
107
|
faqTitle: 'Veelgestelde vragen',
|
|
107
108
|
faq: faqData,
|
|
108
109
|
bibliographyTitle: 'Referenties en documentatie',
|
|
109
|
-
bibliography
|
|
110
|
-
{
|
|
111
|
-
name: 'MDN Web Docs: HTMLCanvasElement.toDataURL()',
|
|
112
|
-
url: 'https://developer.mozilla.org/nl/docs/Web/API/HTMLCanvasElement/toDataURL',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'MDN Web Docs: CanvasRenderingContext2D',
|
|
116
|
-
url: 'https://developer.mozilla.org/nl/docs/Web/API/CanvasRenderingContext2D',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: 'W3C: HTML Canvas 2D Context',
|
|
120
|
-
url: 'https://www.w3.org/TR/2dcontext/',
|
|
121
|
-
},
|
|
122
|
-
],
|
|
110
|
+
bibliography,
|
|
123
111
|
howTo: howToData,
|
|
124
112
|
schemas: [faqSchema, howToSchema, appSchema],
|
|
125
113
|
seo: [
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { bibliography } from '../bibliography';
|
|
1
2
|
import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
|
|
2
3
|
import type { ToolLocaleContent } from '../../../types';
|
|
3
4
|
import type { PlaceholderGeneratorUI } from '../ui';
|
|
@@ -106,20 +107,7 @@ export const content: ToolLocaleContent<PlaceholderGeneratorUI> = {
|
|
|
106
107
|
faqTitle: 'Często Zadawane Pytania',
|
|
107
108
|
faq: faqData,
|
|
108
109
|
bibliographyTitle: 'Referencje i Dokumentacja',
|
|
109
|
-
bibliography
|
|
110
|
-
{
|
|
111
|
-
name: 'MDN Web Docs: HTMLCanvasElement.toDataURL()',
|
|
112
|
-
url: 'https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'MDN Web Docs: CanvasRenderingContext2D',
|
|
116
|
-
url: 'https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: 'W3C: HTML Canvas 2D Context',
|
|
120
|
-
url: 'https://www.w3.org/TR/2dcontext/',
|
|
121
|
-
},
|
|
122
|
-
],
|
|
110
|
+
bibliography,
|
|
123
111
|
howTo: howToData,
|
|
124
112
|
schemas: [faqSchema, howToSchema, appSchema],
|
|
125
113
|
seo: [
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { bibliography } from '../bibliography';
|
|
1
2
|
import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
|
|
2
3
|
import type { ToolLocaleContent } from '../../../types';
|
|
3
4
|
import type { PlaceholderGeneratorUI } from '../ui';
|
|
@@ -106,20 +107,7 @@ export const content: ToolLocaleContent<PlaceholderGeneratorUI> = {
|
|
|
106
107
|
faqTitle: 'Perguntas Frequentes',
|
|
107
108
|
faq: faqData,
|
|
108
109
|
bibliographyTitle: 'Referências e Documentação',
|
|
109
|
-
bibliography
|
|
110
|
-
{
|
|
111
|
-
name: 'MDN Web Docs: HTMLCanvasElement.toDataURL()',
|
|
112
|
-
url: 'https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'MDN Web Docs: CanvasRenderingContext2D',
|
|
116
|
-
url: 'https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: 'W3C: HTML Canvas 2D Context',
|
|
120
|
-
url: 'https://www.w3.org/TR/2dcontext/',
|
|
121
|
-
},
|
|
122
|
-
],
|
|
110
|
+
bibliography,
|
|
123
111
|
howTo: howToData,
|
|
124
112
|
schemas: [faqSchema, howToSchema, appSchema],
|
|
125
113
|
seo: [
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { bibliography } from '../bibliography';
|
|
1
2
|
import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
|
|
2
3
|
import type { ToolLocaleContent } from '../../../types';
|
|
3
4
|
import type { PlaceholderGeneratorUI } from '../ui';
|
|
@@ -106,20 +107,7 @@ export const content: ToolLocaleContent<PlaceholderGeneratorUI> = {
|
|
|
106
107
|
faqTitle: 'Часто Задаваемые Вопросы',
|
|
107
108
|
faq: faqData,
|
|
108
109
|
bibliographyTitle: 'Ссылки и Документация',
|
|
109
|
-
bibliography
|
|
110
|
-
{
|
|
111
|
-
name: 'MDN Web Docs: HTMLCanvasElement.toDataURL()',
|
|
112
|
-
url: 'https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'MDN Web Docs: CanvasRenderingContext2D',
|
|
116
|
-
url: 'https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: 'W3C: HTML Canvas 2D Context',
|
|
120
|
-
url: 'https://www.w3.org/TR/2dcontext/',
|
|
121
|
-
},
|
|
122
|
-
],
|
|
110
|
+
bibliography,
|
|
123
111
|
howTo: howToData,
|
|
124
112
|
schemas: [faqSchema, howToSchema, appSchema],
|
|
125
113
|
seo: [
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { bibliography } from '../bibliography';
|
|
1
2
|
import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
|
|
2
3
|
import type { ToolLocaleContent } from '../../../types';
|
|
3
4
|
import type { PlaceholderGeneratorUI } from '../ui';
|
|
@@ -106,20 +107,7 @@ export const content: ToolLocaleContent<PlaceholderGeneratorUI> = {
|
|
|
106
107
|
faqTitle: 'Vanliga Frågor',
|
|
107
108
|
faq: faqData,
|
|
108
109
|
bibliographyTitle: 'Referenser och Dokumentation',
|
|
109
|
-
bibliography
|
|
110
|
-
{
|
|
111
|
-
name: 'MDN Web Docs: HTMLCanvasElement.toDataURL()',
|
|
112
|
-
url: 'https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'MDN Web Docs: CanvasRenderingContext2D',
|
|
116
|
-
url: 'https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: 'W3C: HTML Canvas 2D Context',
|
|
120
|
-
url: 'https://www.w3.org/TR/2dcontext/',
|
|
121
|
-
},
|
|
122
|
-
],
|
|
110
|
+
bibliography,
|
|
123
111
|
howTo: howToData,
|
|
124
112
|
schemas: [faqSchema, howToSchema, appSchema],
|
|
125
113
|
seo: [
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { bibliography } from '../bibliography';
|
|
1
2
|
import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
|
|
2
3
|
import type { ToolLocaleContent } from '../../../types';
|
|
3
4
|
import type { PlaceholderGeneratorUI } from '../ui';
|
|
@@ -106,20 +107,7 @@ export const content: ToolLocaleContent<PlaceholderGeneratorUI> = {
|
|
|
106
107
|
faqTitle: 'Sık Sorulan Sorular',
|
|
107
108
|
faq: faqData,
|
|
108
109
|
bibliographyTitle: 'Referanslar ve Belgeler',
|
|
109
|
-
bibliography
|
|
110
|
-
{
|
|
111
|
-
name: 'MDN Web Docs: HTMLCanvasElement.toDataURL()',
|
|
112
|
-
url: 'https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'MDN Web Docs: CanvasRenderingContext2D',
|
|
116
|
-
url: 'https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: 'W3C: HTML Canvas 2D Context',
|
|
120
|
-
url: 'https://www.w3.org/TR/2dcontext/',
|
|
121
|
-
},
|
|
122
|
-
],
|
|
110
|
+
bibliography,
|
|
123
111
|
howTo: howToData,
|
|
124
112
|
schemas: [faqSchema, howToSchema, appSchema],
|
|
125
113
|
seo: [
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { bibliography } from '../bibliography';
|
|
1
2
|
import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
|
|
2
3
|
import type { ToolLocaleContent } from '../../../types';
|
|
3
4
|
import type { PlaceholderGeneratorUI } from '../ui';
|
|
@@ -106,20 +107,7 @@ export const content: ToolLocaleContent<PlaceholderGeneratorUI> = {
|
|
|
106
107
|
faqTitle: '常见问题',
|
|
107
108
|
faq: faqData,
|
|
108
109
|
bibliographyTitle: '参考资料和文档',
|
|
109
|
-
bibliography
|
|
110
|
-
{
|
|
111
|
-
name: 'MDN Web Docs: HTMLCanvasElement.toDataURL()',
|
|
112
|
-
url: 'https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'MDN Web Docs: CanvasRenderingContext2D',
|
|
116
|
-
url: 'https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: 'W3C: HTML Canvas 2D Context',
|
|
120
|
-
url: 'https://www.w3.org/TR/2dcontext/',
|
|
121
|
-
},
|
|
122
|
-
],
|
|
110
|
+
bibliography,
|
|
123
111
|
howTo: howToData,
|
|
124
112
|
schemas: [faqSchema, howToSchema, appSchema],
|
|
125
113
|
seo: [
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { CompositionState } from './logic';
|
|
2
|
+
import type { RenderAssets } from './dom-views';
|
|
3
|
+
import { writeState } from './storage';
|
|
4
|
+
import type { PromoteThisWebsiteUI } from './ui';
|
|
5
|
+
|
|
6
|
+
function query<T extends HTMLElement>(root: HTMLElement, selector: string): T | null {
|
|
7
|
+
return root.querySelector(selector) as T | null;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function loadImage(source: string): Promise<HTMLImageElement> {
|
|
11
|
+
return new Promise((resolve, reject) => {
|
|
12
|
+
const image = new Image();
|
|
13
|
+
if (source.startsWith('http')) image.crossOrigin = 'anonymous';
|
|
14
|
+
image.onload = () => resolve(image);
|
|
15
|
+
image.onerror = () => reject(new Error('Image could not be loaded'));
|
|
16
|
+
image.src = source;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function loadDefaultMascot(): Promise<HTMLImageElement> {
|
|
21
|
+
return loadImage(new URL('./pixel-cat.png', import.meta.url).href);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function readFile(file: File): Promise<string> {
|
|
25
|
+
return new Promise((resolve, reject) => {
|
|
26
|
+
const reader = new FileReader();
|
|
27
|
+
reader.onload = () => resolve(String(reader.result));
|
|
28
|
+
reader.onerror = () => reject(reader.error);
|
|
29
|
+
reader.readAsDataURL(file);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface CanvasDownload {
|
|
34
|
+
root: HTMLElement;
|
|
35
|
+
state: CompositionState;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function downloadCanvas(input: CanvasDownload): void {
|
|
39
|
+
const canvas = query<HTMLCanvasElement>(input.root, '#promote-canvas');
|
|
40
|
+
if (!canvas) return;
|
|
41
|
+
canvas.toBlob((blob) => {
|
|
42
|
+
if (!blob) return;
|
|
43
|
+
const link = document.createElement('a');
|
|
44
|
+
link.download = `promote-this-website-${input.state.format}.png`;
|
|
45
|
+
link.href = URL.createObjectURL(blob);
|
|
46
|
+
link.click();
|
|
47
|
+
URL.revokeObjectURL(link.href);
|
|
48
|
+
}, 'image/png');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface PasteBinding {
|
|
52
|
+
root: HTMLElement;
|
|
53
|
+
stateRef: { current: CompositionState };
|
|
54
|
+
assets: RenderAssets;
|
|
55
|
+
ui: PromoteThisWebsiteUI;
|
|
56
|
+
draw: (root: HTMLElement, state: CompositionState, assets: RenderAssets, ui: PromoteThisWebsiteUI) => void;
|
|
57
|
+
setStatus: (root: HTMLElement, message: string) => void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function bindPaste(binding: PasteBinding): void {
|
|
61
|
+
document.addEventListener('paste', async (event) => {
|
|
62
|
+
const item = Array.from(event.clipboardData?.items || []).find((entry) => entry.type.startsWith('image/'));
|
|
63
|
+
if (!item) return;
|
|
64
|
+
event.preventDefault();
|
|
65
|
+
const file = item.getAsFile();
|
|
66
|
+
if (!file) return;
|
|
67
|
+
binding.assets.tool = await loadImage(await readFile(file));
|
|
68
|
+
binding.stateRef.current.active = 'tool';
|
|
69
|
+
writeState(binding.stateRef.current);
|
|
70
|
+
binding.draw(binding.root, binding.stateRef.current, binding.assets, binding.ui);
|
|
71
|
+
binding.setStatus(binding.root, binding.ui.pasted);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Bibliography as SharedBibliography } from '@jjlmoya/utils-shared';
|
|
3
|
+
import { promoteThisWebsite } from './index';
|
|
4
|
+
import type { KnownLocale } from '../../types';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
locale?: KnownLocale;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { locale = 'en' } = Astro.props;
|
|
11
|
+
const content = await promoteThisWebsite.i18n[locale]?.();
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
{content && <SharedBibliography links={content.bibliography} />}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const bibliography = [
|
|
2
|
+
{
|
|
3
|
+
name: 'jjlmoya resistance colour calculator',
|
|
4
|
+
url: 'https://www.jjlmoya.es/utilidades/calculadora-codigo-colores-resistencia/',
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
name: 'jjlmoya utilities index',
|
|
8
|
+
url: 'https://www.jjlmoya.es/utilidades/',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'GameBob team and feline management board',
|
|
12
|
+
url: 'https://www.gamebob.dev/de/mannschaft/',
|
|
13
|
+
},
|
|
14
|
+
];
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
---
|
|
2
|
+
import './promote-this-website.css';
|
|
3
|
+
import type { PromoteThisWebsiteUI } from './ui';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
ui: PromoteThisWebsiteUI;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { ui } = Astro.props;
|
|
10
|
+
const uiData = JSON.stringify(ui);
|
|
11
|
+
const layerRows = [
|
|
12
|
+
['background', 'backgroundLayer'],
|
|
13
|
+
['tool', 'toolLayer'],
|
|
14
|
+
['brand', 'logoLayer'],
|
|
15
|
+
['mascot', 'mascotLayer'],
|
|
16
|
+
['title', 'titleLayer'],
|
|
17
|
+
] as const;
|
|
18
|
+
const formatOptions = [
|
|
19
|
+
['panoramic', ui.panoramic],
|
|
20
|
+
['instagram', ui.instagram],
|
|
21
|
+
['square', ui.square],
|
|
22
|
+
['story', ui.story],
|
|
23
|
+
] as const;
|
|
24
|
+
const titleStyleOptions = [
|
|
25
|
+
['paper', ui.titlePaper], ['ribbon', ui.titleRibbon], ['ink', ui.titleInk], ['poster', ui.titlePoster], ['ticket', ui.titleTicket],
|
|
26
|
+
['marker', ui.titleMarker], ['split', ui.titleSplit], ['capsule', ui.titleCapsule], ['corner', ui.titleCorner], ['vertical', ui.titleVertical],
|
|
27
|
+
] as const;
|
|
28
|
+
const brandOptions = [['jjlmoya.es', 'jjlmoya.es'], ['GameBob.dev', 'GameBob.dev']] as const;
|
|
29
|
+
const brandStyleOptions = [
|
|
30
|
+
['plain', ui.brandPlain], ['plaque', ui.brandPlaque], ['ticket', ui.brandTicket], ['stamp', ui.brandStamp], ['neon', ui.brandNeon],
|
|
31
|
+
['ribbon', ui.brandRibbon], ['corner', ui.brandCorner], ['pixel', ui.brandPixel], ['halo', ui.brandHalo], ['editorial', ui.brandEditorial],
|
|
32
|
+
] as const;
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
<div class="promote-tool" id="promote-this-website" data-ui={uiData}>
|
|
36
|
+
<aside class="promote-sidebar" aria-label={ui.urlLabel}>
|
|
37
|
+
<div class="promote-control-group">
|
|
38
|
+
<label for="promote-url">{ui.urlLabel}</label>
|
|
39
|
+
<div class="promote-inline-control">
|
|
40
|
+
<input id="promote-url" type="url" placeholder={ui.urlPlaceholder} />
|
|
41
|
+
<button id="promote-apply-url" type="button">{ui.applyUrl}</button>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div class="promote-control-grid">
|
|
46
|
+
<label for="promote-format-trigger">{ui.formatLabel}</label>
|
|
47
|
+
<div class="promote-custom-select" data-promote-select="format" data-value="panoramic">
|
|
48
|
+
<button id="promote-format-trigger" class="promote-select-trigger" type="button" aria-haspopup="listbox" aria-expanded="false">
|
|
49
|
+
<span data-select-label>{ui.panoramic}</span>
|
|
50
|
+
</button>
|
|
51
|
+
<div class="promote-select-menu" role="listbox" tabindex="-1" hidden>
|
|
52
|
+
{formatOptions.map(([value, label]) => <button class="promote-select-option" type="button" role="option" data-value={value} aria-selected={value === 'panoramic'}>{label}</button>)}
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
<label for="promote-title">{ui.titleLabel}</label>
|
|
56
|
+
<input id="promote-title" type="text" placeholder={ui.titlePlaceholder} />
|
|
57
|
+
<label for="promote-title-size">{ui.titleSizeLabel}</label>
|
|
58
|
+
<input id="promote-title-size" type="range" min="0.45" max="1" step="0.01" value="1" aria-label={ui.titleSizeLabel} />
|
|
59
|
+
<label for="promote-title-box-size">{ui.titleBoxSizeLabel}</label>
|
|
60
|
+
<input id="promote-title-box-size" type="range" min="0.5" max="2.4" step="0.01" value="1" aria-label={ui.titleBoxSizeLabel} />
|
|
61
|
+
<label for="promote-title-style-trigger">{ui.titleStyleLabel}</label>
|
|
62
|
+
<div class="promote-custom-select" data-promote-select="title-style" data-value="paper">
|
|
63
|
+
<button id="promote-title-style-trigger" class="promote-select-trigger" type="button" aria-haspopup="listbox" aria-expanded="false">
|
|
64
|
+
<span data-select-label>{ui.titlePaper}</span>
|
|
65
|
+
</button>
|
|
66
|
+
<div class="promote-select-menu" role="listbox" tabindex="-1" hidden>
|
|
67
|
+
{titleStyleOptions.map(([value, label]) => <button class="promote-select-option" type="button" role="option" data-value={value} aria-selected={value === 'paper'}>{label}</button>)}
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
<label for="promote-brand-trigger">{ui.brandLabel}</label>
|
|
71
|
+
<div class="promote-custom-select" data-promote-select="brand" data-value="jjlmoya.es">
|
|
72
|
+
<button id="promote-brand-trigger" class="promote-select-trigger" type="button" aria-haspopup="listbox" aria-expanded="false">
|
|
73
|
+
<span data-select-label>jjlmoya.es</span>
|
|
74
|
+
</button>
|
|
75
|
+
<div class="promote-select-menu" role="listbox" tabindex="-1" hidden>
|
|
76
|
+
{brandOptions.map(([value, label]) => <button class="promote-select-option" type="button" role="option" data-value={value} aria-selected={value === 'jjlmoya.es'}>{label}</button>)}
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
<label for="promote-brand-style-trigger">{ui.brandStyleLabel}</label>
|
|
80
|
+
<div class="promote-custom-select" data-promote-select="brand-style" data-value="plain">
|
|
81
|
+
<button id="promote-brand-style-trigger" class="promote-select-trigger" type="button" aria-haspopup="listbox" aria-expanded="false">
|
|
82
|
+
<span data-select-label>{ui.brandPlain}</span>
|
|
83
|
+
</button>
|
|
84
|
+
<div class="promote-select-menu" role="listbox" tabindex="-1" hidden>
|
|
85
|
+
{brandStyleOptions.map(([value, label]) => <button class="promote-select-option" type="button" role="option" data-value={value} aria-selected={value === 'plain'}>{label}</button>)}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<details class="promote-advanced">
|
|
91
|
+
<summary>{ui.advancedLabel}</summary>
|
|
92
|
+
<fieldset class="promote-fieldset">
|
|
93
|
+
<legend>{ui.assetsLabel}</legend>
|
|
94
|
+
<label>{ui.backgroundLabel}<input id="promote-background-file" type="file" accept="image/*" /></label>
|
|
95
|
+
<label>{ui.toolLabel}<input id="promote-tool-file" type="file" accept="image/*" /></label>
|
|
96
|
+
<label>{ui.logoLabel}<input id="promote-brand-file" type="file" accept="image/*" /></label>
|
|
97
|
+
<label>{ui.mascotLabel}<input id="promote-mascot-file" type="file" accept="image/*" /></label>
|
|
98
|
+
</fieldset>
|
|
99
|
+
|
|
100
|
+
<fieldset class="promote-fieldset promote-layers">
|
|
101
|
+
<legend>{ui.layersLabel}</legend>
|
|
102
|
+
{layerRows.map(([key, labelKey]) => (
|
|
103
|
+
<label class="promote-layer" for={`promote-${key}-visible`}>
|
|
104
|
+
<span><input id={`promote-${key}-visible`} type="checkbox" checked /> {ui[labelKey]}</span>
|
|
105
|
+
<input id={`promote-${key}-scale`} type="range" min="0.35" max="3.5" step="0.01" value="1" aria-label={`${ui[labelKey]} scale`} />
|
|
106
|
+
</label>
|
|
107
|
+
))}
|
|
108
|
+
</fieldset>
|
|
109
|
+
|
|
110
|
+
</details>
|
|
111
|
+
|
|
112
|
+
<div class="promote-actions">
|
|
113
|
+
<button id="promote-reset" type="button">{ui.reset}</button>
|
|
114
|
+
<button id="promote-download" class="promote-primary" type="button">{ui.download}</button>
|
|
115
|
+
</div>
|
|
116
|
+
<p class="promote-status" id="promote-status" aria-live="polite">{ui.canvasHint}</p>
|
|
117
|
+
</aside>
|
|
118
|
+
|
|
119
|
+
<main class="promote-stage">
|
|
120
|
+
<div class="promote-stage-meta">
|
|
121
|
+
<span id="promote-active">{ui.activeLayer}: {ui.toolLayer}</span>
|
|
122
|
+
<span id="promote-size">1536 × 1024</span>
|
|
123
|
+
</div>
|
|
124
|
+
<div class="promote-canvas-wrap">
|
|
125
|
+
<canvas id="promote-canvas" aria-label={ui.canvasHint}></canvas>
|
|
126
|
+
</div>
|
|
127
|
+
</main>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<script>
|
|
131
|
+
import { mountPromoteThisWebsite } from './controller';
|
|
132
|
+
import type { PromoteThisWebsiteUI } from './ui';
|
|
133
|
+
|
|
134
|
+
const root = document.getElementById('promote-this-website');
|
|
135
|
+
if (root) mountPromoteThisWebsite(root, JSON.parse(root.dataset.ui || '{}') as PromoteThisWebsiteUI);
|
|
136
|
+
</script>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { activeLabel } from './evaluator';
|
|
2
|
+
import type { CompositionState, LayerKey } from './logic';
|
|
3
|
+
import type { PromoteThisWebsiteUI } from './ui';
|
|
4
|
+
|
|
5
|
+
const labels: Record<LayerKey, keyof PromoteThisWebsiteUI> = { background: 'backgroundLayer', tool: 'toolLayer', brand: 'logoLayer', mascot: 'mascotLayer', title: 'titleLayer' };
|
|
6
|
+
|
|
7
|
+
function query<T extends HTMLElement>(root: HTMLElement, selector: string): T | null {
|
|
8
|
+
return root.querySelector(selector) as T | null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function syncValue(root: HTMLElement, selector: string, value: string): void {
|
|
12
|
+
const control = query<HTMLInputElement>(root, selector);
|
|
13
|
+
if (control) control.value = value;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function setMenuPlacement(trigger: HTMLElement, menu: HTMLElement): void {
|
|
17
|
+
const triggerRect = trigger.getBoundingClientRect();
|
|
18
|
+
const roomBelow = window.innerHeight - triggerRect.bottom;
|
|
19
|
+
const roomAbove = triggerRect.top;
|
|
20
|
+
menu.dataset.placement = roomBelow < 260 && roomAbove > roomBelow ? 'top' : 'bottom';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function syncCustomValue(root: HTMLElement, key: string, value: string): void {
|
|
24
|
+
const control = query<HTMLElement>(root, `[data-promote-select="${key}"]`);
|
|
25
|
+
if (!control) return;
|
|
26
|
+
control.dataset.value = value;
|
|
27
|
+
const option = query<HTMLElement>(control, `[data-value="${value}"]`);
|
|
28
|
+
const label = query<HTMLElement>(control, '[data-select-label]');
|
|
29
|
+
if (label && option) label.textContent = option.textContent;
|
|
30
|
+
control.querySelectorAll<HTMLElement>('[role="option"]').forEach((item) => { item.setAttribute('aria-selected', String(item.dataset.value === value)); });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function bindCustomSelect(root: HTMLElement, key: string, onChange: (value: string) => void): void {
|
|
34
|
+
const control = query<HTMLElement>(root, `[data-promote-select="${key}"]`);
|
|
35
|
+
const trigger = query<HTMLButtonElement>(control || root, '.promote-select-trigger');
|
|
36
|
+
const menu = query<HTMLElement>(control || root, '.promote-select-menu');
|
|
37
|
+
if (!control || !trigger || !menu) return;
|
|
38
|
+
const close = () => { menu.hidden = true; trigger.setAttribute('aria-expanded', 'false'); };
|
|
39
|
+
const open = () => {
|
|
40
|
+
setMenuPlacement(trigger, menu);
|
|
41
|
+
root.querySelectorAll<HTMLElement>('.promote-select-menu').forEach((item) => { item.hidden = true; });
|
|
42
|
+
root.querySelectorAll<HTMLButtonElement>('.promote-select-trigger').forEach((item) => { item.setAttribute('aria-expanded', 'false'); });
|
|
43
|
+
menu.hidden = false;
|
|
44
|
+
trigger.setAttribute('aria-expanded', 'true');
|
|
45
|
+
};
|
|
46
|
+
const choose = (option: HTMLElement) => {
|
|
47
|
+
const value = option.dataset.value;
|
|
48
|
+
if (!value) return;
|
|
49
|
+
syncCustomValue(root, key, value);
|
|
50
|
+
close();
|
|
51
|
+
onChange(value);
|
|
52
|
+
};
|
|
53
|
+
trigger.addEventListener('click', () => { if (menu.hidden) open(); else close(); });
|
|
54
|
+
trigger.addEventListener('keydown', (event) => {
|
|
55
|
+
if (event.key === 'ArrowDown' || event.key === 'Enter' || event.key === ' ') { event.preventDefault(); open(); }
|
|
56
|
+
if (event.key === 'Escape') close();
|
|
57
|
+
});
|
|
58
|
+
menu.querySelectorAll<HTMLElement>('[role="option"]').forEach((option) => option.addEventListener('click', () => choose(option)));
|
|
59
|
+
root.addEventListener('click', (event) => { if (!control.contains(event.target as Node)) close(); });
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function syncControls(root: HTMLElement, state: CompositionState, ui: PromoteThisWebsiteUI): void {
|
|
63
|
+
syncValue(root, '#promote-url', state.sourceUrl);
|
|
64
|
+
syncCustomValue(root, 'format', state.format);
|
|
65
|
+
syncValue(root, '#promote-title', state.title);
|
|
66
|
+
syncValue(root, '#promote-title-size', state.titleFontSize.toString());
|
|
67
|
+
syncValue(root, '#promote-title-box-size', state.scale.title.toString());
|
|
68
|
+
syncCustomValue(root, 'title-style', state.titleStyle);
|
|
69
|
+
syncCustomValue(root, 'brand', state.brand);
|
|
70
|
+
syncCustomValue(root, 'brand-style', state.brandStyle);
|
|
71
|
+
syncLayerControls(root, state);
|
|
72
|
+
const label = query<HTMLElement>(root, '#promote-active');
|
|
73
|
+
if (label) label.textContent = `${ui.activeLayer}: ${activeLabel(state, Object.fromEntries(Object.entries(labels).map(([key, value]) => [key, ui[value]])) as Record<LayerKey, string>)}`;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function syncLayerControls(root: HTMLElement, state: CompositionState): void {
|
|
77
|
+
(Object.keys(state.visible) as LayerKey[]).forEach((key) => {
|
|
78
|
+
const visible = query<HTMLInputElement>(root, `#promote-${key}-visible`);
|
|
79
|
+
if (visible) visible.checked = state.visible[key];
|
|
80
|
+
const scale = query<HTMLInputElement>(root, `#promote-${key}-scale`);
|
|
81
|
+
if (scale) scale.value = state.scale[key].toString();
|
|
82
|
+
});
|
|
83
|
+
}
|