@focus-reactive/payload-plugin-seo 1.10.2 → 1.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/README.md +141 -8
- package/dist/admin.css +28 -1
- package/dist/components/SeoButton/RemoteKeyphrasesGate.d.ts +7 -0
- package/dist/components/SeoButton/RemoteKeyphrasesGate.d.ts.map +1 -0
- package/dist/components/SeoButton/RemoteKeyphrasesGate.js +23 -0
- package/dist/components/SeoButton/RemoteKeyphrasesGate.js.map +1 -0
- package/dist/components/SeoButton/ScoreBadge.d.ts.map +1 -1
- package/dist/components/SeoButton/ScoreBadge.js +10 -1
- package/dist/components/SeoButton/ScoreBadge.js.map +1 -1
- package/dist/components/SeoButton/SeoButtonInner.d.ts +7 -1
- package/dist/components/SeoButton/SeoButtonInner.d.ts.map +1 -1
- package/dist/components/SeoButton/SeoButtonInner.js +20 -24
- package/dist/components/SeoButton/SeoButtonInner.js.map +1 -1
- package/dist/components/SeoButton/SeoTriggerButton.d.ts +9 -0
- package/dist/components/SeoButton/SeoTriggerButton.d.ts.map +1 -0
- package/dist/components/SeoButton/SeoTriggerButton.js +31 -0
- package/dist/components/SeoButton/SeoTriggerButton.js.map +1 -0
- package/dist/components/SeoButton/index.d.ts.map +1 -1
- package/dist/components/SeoButton/index.js +6 -1
- package/dist/components/SeoButton/index.js.map +1 -1
- package/dist/components/SeoDrawer/TabsNav/constants.d.ts +2 -1
- package/dist/components/SeoDrawer/TabsNav/constants.d.ts.map +1 -1
- package/dist/components/SeoDrawer/TabsNav/constants.js +13 -8
- package/dist/components/SeoDrawer/TabsNav/constants.js.map +1 -1
- package/dist/components/SeoDrawer/TabsNav/index.d.ts +4 -2
- package/dist/components/SeoDrawer/TabsNav/index.d.ts.map +1 -1
- package/dist/components/SeoDrawer/TabsNav/index.js +8 -4
- package/dist/components/SeoDrawer/TabsNav/index.js.map +1 -1
- package/dist/components/SeoDrawer/TabsNav/types.d.ts +3 -2
- package/dist/components/SeoDrawer/TabsNav/types.d.ts.map +1 -1
- package/dist/components/SeoDrawer/components/Header.d.ts.map +1 -1
- package/dist/components/SeoDrawer/components/Header.js +4 -2
- package/dist/components/SeoDrawer/components/Header.js.map +1 -1
- package/dist/components/SeoDrawer/components/HeadingsSection/HeadingIssueBanner.d.ts.map +1 -1
- package/dist/components/SeoDrawer/components/HeadingsSection/HeadingIssueBanner.js +4 -2
- package/dist/components/SeoDrawer/components/HeadingsSection/HeadingIssueBanner.js.map +1 -1
- package/dist/components/SeoDrawer/components/HeadingsSection/HeadingIssuePills.d.ts.map +1 -1
- package/dist/components/SeoDrawer/components/HeadingsSection/HeadingIssuePills.js +4 -5
- package/dist/components/SeoDrawer/components/HeadingsSection/HeadingIssuePills.js.map +1 -1
- package/dist/components/SeoDrawer/components/HeadingsSection/HeadingTree/HeadingTreeRow.d.ts.map +1 -1
- package/dist/components/SeoDrawer/components/HeadingsSection/HeadingTree/HeadingTreeRow.js +5 -3
- package/dist/components/SeoDrawer/components/HeadingsSection/HeadingTree/HeadingTreeRow.js.map +1 -1
- package/dist/components/SeoDrawer/components/HeadingsSection/HeadingTree/index.d.ts.map +1 -1
- package/dist/components/SeoDrawer/components/HeadingsSection/HeadingTree/index.js +5 -3
- package/dist/components/SeoDrawer/components/HeadingsSection/HeadingTree/index.js.map +1 -1
- package/dist/components/SeoDrawer/components/HeadingsSection/headingIssueCopy.d.ts +3 -2
- package/dist/components/SeoDrawer/components/HeadingsSection/headingIssueCopy.d.ts.map +1 -1
- package/dist/components/SeoDrawer/components/HeadingsSection/headingIssueCopy.js +5 -5
- package/dist/components/SeoDrawer/components/HeadingsSection/headingIssueCopy.js.map +1 -1
- package/dist/components/SeoDrawer/components/HeadingsSection/index.d.ts.map +1 -1
- package/dist/components/SeoDrawer/components/HeadingsSection/index.js +4 -2
- package/dist/components/SeoDrawer/components/HeadingsSection/index.js.map +1 -1
- package/dist/components/SeoDrawer/index.d.ts +5 -0
- package/dist/components/SeoDrawer/index.d.ts.map +1 -1
- package/dist/components/SeoDrawer/index.js +18 -6
- package/dist/components/SeoDrawer/index.js.map +1 -1
- package/dist/components/SeoDrawer/keyphraseStorage.d.ts +7 -1
- package/dist/components/SeoDrawer/keyphraseStorage.d.ts.map +1 -1
- package/dist/components/SeoDrawer/keyphraseStorage.js +41 -24
- package/dist/components/SeoDrawer/keyphraseStorage.js.map +1 -1
- package/dist/components/SeoDrawer/languagePacks.d.ts.map +1 -1
- package/dist/components/SeoDrawer/languagePacks.js +8 -2
- package/dist/components/SeoDrawer/languagePacks.js.map +1 -1
- package/dist/components/SeoDrawer/links/readContent.d.ts +7 -0
- package/dist/components/SeoDrawer/links/readContent.d.ts.map +1 -0
- package/dist/components/SeoDrawer/links/readContent.js +21 -0
- package/dist/components/SeoDrawer/links/readContent.js.map +1 -0
- package/dist/components/SeoDrawer/links/readInternalLinks.d.ts +3 -0
- package/dist/components/SeoDrawer/links/readInternalLinks.d.ts.map +1 -0
- package/dist/components/SeoDrawer/links/readInternalLinks.js +35 -0
- package/dist/components/SeoDrawer/links/readInternalLinks.js.map +1 -0
- package/dist/components/SeoDrawer/links/useLinkSuggestions.d.ts +27 -0
- package/dist/components/SeoDrawer/links/useLinkSuggestions.d.ts.map +1 -0
- package/dist/components/SeoDrawer/links/useLinkSuggestions.js +65 -0
- package/dist/components/SeoDrawer/links/useLinkSuggestions.js.map +1 -0
- package/dist/components/SeoDrawer/remoteSaver.d.ts +30 -0
- package/dist/components/SeoDrawer/remoteSaver.d.ts.map +1 -0
- package/dist/components/SeoDrawer/remoteSaver.js +81 -0
- package/dist/components/SeoDrawer/remoteSaver.js.map +1 -0
- package/dist/components/SeoDrawer/tabs/InclusiveTab.d.ts.map +1 -1
- package/dist/components/SeoDrawer/tabs/InclusiveTab.js +36 -32
- package/dist/components/SeoDrawer/tabs/InclusiveTab.js.map +1 -1
- package/dist/components/SeoDrawer/tabs/KeyphraseTab.d.ts +4 -1
- package/dist/components/SeoDrawer/tabs/KeyphraseTab.d.ts.map +1 -1
- package/dist/components/SeoDrawer/tabs/KeyphraseTab.js +13 -5
- package/dist/components/SeoDrawer/tabs/KeyphraseTab.js.map +1 -1
- package/dist/components/SeoDrawer/tabs/LinksTab.d.ts +7 -0
- package/dist/components/SeoDrawer/tabs/LinksTab.d.ts.map +1 -0
- package/dist/components/SeoDrawer/tabs/LinksTab.js +66 -0
- package/dist/components/SeoDrawer/tabs/LinksTab.js.map +1 -0
- package/dist/components/SeoDrawer/tabs/OnPageTab.d.ts.map +1 -1
- package/dist/components/SeoDrawer/tabs/OnPageTab.js +16 -12
- package/dist/components/SeoDrawer/tabs/OnPageTab.js.map +1 -1
- package/dist/components/SeoDrawer/tabs/ReadabilityTab.d.ts.map +1 -1
- package/dist/components/SeoDrawer/tabs/ReadabilityTab.js +16 -12
- package/dist/components/SeoDrawer/tabs/ReadabilityTab.js.map +1 -1
- package/dist/components/SeoDrawer/tabs/SerpTab.d.ts.map +1 -1
- package/dist/components/SeoDrawer/tabs/SerpTab.js +6 -4
- package/dist/components/SeoDrawer/tabs/SerpTab.js.map +1 -1
- package/dist/components/SeoDrawer/tabs/VitalsTab.d.ts.map +1 -1
- package/dist/components/SeoDrawer/tabs/VitalsTab.js +18 -9
- package/dist/components/SeoDrawer/tabs/VitalsTab.js.map +1 -1
- package/dist/components/SeoDrawer/tabs/keyphrase/KeyphraseCard.d.ts.map +1 -1
- package/dist/components/SeoDrawer/tabs/keyphrase/KeyphraseCard.js +4 -2
- package/dist/components/SeoDrawer/tabs/keyphrase/KeyphraseCard.js.map +1 -1
- package/dist/components/SeoDrawer/tabs/keyphrase/KeyphraseDetail.d.ts +6 -2
- package/dist/components/SeoDrawer/tabs/keyphrase/KeyphraseDetail.d.ts.map +1 -1
- package/dist/components/SeoDrawer/tabs/keyphrase/KeyphraseDetail.js +44 -38
- package/dist/components/SeoDrawer/tabs/keyphrase/KeyphraseDetail.js.map +1 -1
- package/dist/components/SeoDrawer/tabs/keyphrase/KeyphraseRail.d.ts +3 -1
- package/dist/components/SeoDrawer/tabs/keyphrase/KeyphraseRail.d.ts.map +1 -1
- package/dist/components/SeoDrawer/tabs/keyphrase/KeyphraseRail.js +12 -11
- package/dist/components/SeoDrawer/tabs/keyphrase/KeyphraseRail.js.map +1 -1
- package/dist/components/SeoDrawer/tabs/keyphrase/KeyphraseUsageNotice.d.ts +8 -0
- package/dist/components/SeoDrawer/tabs/keyphrase/KeyphraseUsageNotice.d.ts.map +1 -0
- package/dist/components/SeoDrawer/tabs/keyphrase/KeyphraseUsageNotice.js +53 -0
- package/dist/components/SeoDrawer/tabs/keyphrase/KeyphraseUsageNotice.js.map +1 -0
- package/dist/components/SeoDrawer/tabs/keyphrase/SynonymsField.d.ts +2 -1
- package/dist/components/SeoDrawer/tabs/keyphrase/SynonymsField.d.ts.map +1 -1
- package/dist/components/SeoDrawer/tabs/keyphrase/SynonymsField.js +14 -10
- package/dist/components/SeoDrawer/tabs/keyphrase/SynonymsField.js.map +1 -1
- package/dist/components/SeoDrawer/tabs/links/LinkSuggestionRow.d.ts +8 -0
- package/dist/components/SeoDrawer/tabs/links/LinkSuggestionRow.d.ts.map +1 -0
- package/dist/components/SeoDrawer/tabs/links/LinkSuggestionRow.js +94 -0
- package/dist/components/SeoDrawer/tabs/links/LinkSuggestionRow.js.map +1 -0
- package/dist/components/SeoDrawer/useFlushOnHide.d.ts +3 -0
- package/dist/components/SeoDrawer/useFlushOnHide.d.ts.map +1 -0
- package/dist/components/SeoDrawer/useFlushOnHide.js +24 -0
- package/dist/components/SeoDrawer/useFlushOnHide.js.map +1 -0
- package/dist/components/SeoDrawer/useKeyphrases.d.ts +12 -1
- package/dist/components/SeoDrawer/useKeyphrases.d.ts.map +1 -1
- package/dist/components/SeoDrawer/useKeyphrases.js +85 -22
- package/dist/components/SeoDrawer/useKeyphrases.js.map +1 -1
- package/dist/components/SeoDrawer/useRemoteSync.d.ts +18 -0
- package/dist/components/SeoDrawer/useRemoteSync.d.ts.map +1 -0
- package/dist/components/SeoDrawer/useRemoteSync.js +42 -0
- package/dist/components/SeoDrawer/useRemoteSync.js.map +1 -0
- package/dist/components/SeoField/Meter.d.ts +3 -2
- package/dist/components/SeoField/Meter.d.ts.map +1 -1
- package/dist/components/SeoField/Meter.js +8 -6
- package/dist/components/SeoField/Meter.js.map +1 -1
- package/dist/components/SeoField/index.d.ts.map +1 -1
- package/dist/components/SeoField/index.js +18 -18
- package/dist/components/SeoField/index.js.map +1 -1
- package/dist/components/SeoField/useGenerate.d.ts.map +1 -1
- package/dist/components/SeoField/useGenerate.js +5 -3
- package/dist/components/SeoField/useGenerate.js.map +1 -1
- package/dist/constants/checkIds.d.ts +1 -0
- package/dist/constants/checkIds.d.ts.map +1 -1
- package/dist/constants/checkIds.js +2 -0
- package/dist/constants/checkIds.js.map +1 -1
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +2 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/keyphrases.d.ts +8 -0
- package/dist/constants/keyphrases.d.ts.map +1 -0
- package/dist/constants/keyphrases.js +17 -0
- package/dist/constants/keyphrases.js.map +1 -0
- package/dist/constants/links.d.ts +11 -0
- package/dist/constants/links.d.ts.map +1 -0
- package/dist/constants/links.js +23 -0
- package/dist/constants/links.js.map +1 -0
- package/dist/constants/statuses.d.ts +2 -1
- package/dist/constants/statuses.d.ts.map +1 -1
- package/dist/constants/statuses.js +5 -5
- package/dist/constants/statuses.js.map +1 -1
- package/dist/content/resolve/resolve-docs.d.ts.map +1 -1
- package/dist/content/resolve/resolve-docs.js +3 -5
- package/dist/content/resolve/resolve-docs.js.map +1 -1
- package/dist/engine/inclusiveScore.d.ts +4 -4
- package/dist/engine/inclusiveScore.d.ts.map +1 -1
- package/dist/engine/inclusiveScore.js +3 -3
- package/dist/engine/inclusiveScore.js.map +1 -1
- package/dist/engine/recommendations.d.ts +2 -1
- package/dist/engine/recommendations.d.ts.map +1 -1
- package/dist/engine/recommendations.js +20 -20
- package/dist/engine/recommendations.js.map +1 -1
- package/dist/engine/researcherAdapter.d.ts +3 -0
- package/dist/engine/researcherAdapter.d.ts.map +1 -1
- package/dist/engine/researcherAdapter.js +17 -2
- package/dist/engine/researcherAdapter.js.map +1 -1
- package/dist/engine/runAnalysis/services/derive-inclusive.d.ts.map +1 -1
- package/dist/engine/runAnalysis/services/derive-inclusive.js +15 -13
- package/dist/engine/runAnalysis/services/derive-inclusive.js.map +1 -1
- package/dist/engine/types/analysis.d.ts +5 -3
- package/dist/engine/types/analysis.d.ts.map +1 -1
- package/dist/engine/types/visualization.d.ts +4 -2
- package/dist/engine/types/visualization.d.ts.map +1 -1
- package/dist/engine/visualization/resolveVisualization/index.js +4 -4
- package/dist/engine/visualization/resolveVisualization/index.js.map +1 -1
- package/dist/engine/visualization/resolveVisualization/resolves/resolveDrilldown.d.ts +2 -2
- package/dist/engine/visualization/resolveVisualization/resolves/resolveDrilldown.d.ts.map +1 -1
- package/dist/engine/visualization/resolveVisualization/resolves/resolveDrilldown.js +2 -6
- package/dist/engine/visualization/resolveVisualization/resolves/resolveDrilldown.js.map +1 -1
- package/dist/engine/visualization/resolveVisualization/resolves/resolveLinks.js +2 -2
- package/dist/engine/visualization/resolveVisualization/resolves/resolveLinks.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/keyphrases/docTarget.d.ts +7 -0
- package/dist/keyphrases/docTarget.d.ts.map +1 -0
- package/dist/keyphrases/docTarget.js +15 -0
- package/dist/keyphrases/docTarget.js.map +1 -0
- package/dist/keyphrases/stored.d.ts +6 -0
- package/dist/keyphrases/stored.d.ts.map +1 -0
- package/dist/keyphrases/stored.js +29 -0
- package/dist/keyphrases/stored.js.map +1 -0
- package/dist/keyphrases/text.d.ts +10 -0
- package/dist/keyphrases/text.d.ts.map +1 -0
- package/dist/keyphrases/text.js +38 -0
- package/dist/keyphrases/text.js.map +1 -0
- package/dist/keyphrases/usage.d.ts +7 -0
- package/dist/keyphrases/usage.d.ts.map +1 -0
- package/dist/keyphrases/usage.js +10 -0
- package/dist/keyphrases/usage.js.map +1 -0
- package/dist/links/toPath.d.ts +3 -0
- package/dist/links/toPath.d.ts.map +1 -0
- package/dist/links/toPath.js +39 -0
- package/dist/links/toPath.js.map +1 -0
- package/dist/links/types.d.ts +15 -0
- package/dist/links/types.d.ts.map +1 -0
- package/dist/links/types.js +1 -0
- package/dist/links/types.js.map +1 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +4 -3
- package/dist/plugin.js.map +1 -1
- package/dist/server/docTargets.d.ts +16 -0
- package/dist/server/docTargets.d.ts.map +1 -0
- package/dist/server/docTargets.js +42 -0
- package/dist/server/docTargets.js.map +1 -0
- package/dist/server/findDocsByIds.d.ts +17 -0
- package/dist/server/findDocsByIds.d.ts.map +1 -0
- package/dist/server/findDocsByIds.js +24 -0
- package/dist/server/findDocsByIds.js.map +1 -0
- package/dist/server/generate/endpoint.d.ts.map +1 -1
- package/dist/server/generate/endpoint.js +5 -11
- package/dist/server/generate/endpoint.js.map +1 -1
- package/dist/server/generate/serverResolveDocs.d.ts.map +1 -1
- package/dist/server/generate/serverResolveDocs.js +9 -18
- package/dist/server/generate/serverResolveDocs.js.map +1 -1
- package/dist/server/http.d.ts +3 -0
- package/dist/server/http.d.ts.map +1 -0
- package/dist/server/http.js +11 -0
- package/dist/server/http.js.map +1 -0
- package/dist/server/keyphrases/authorize.d.ts +8 -0
- package/dist/server/keyphrases/authorize.d.ts.map +1 -0
- package/dist/server/keyphrases/authorize.js +81 -0
- package/dist/server/keyphrases/authorize.js.map +1 -0
- package/dist/server/keyphrases/cleanupHook.d.ts +3 -0
- package/dist/server/keyphrases/cleanupHook.d.ts.map +1 -0
- package/dist/server/keyphrases/cleanupHook.js +16 -0
- package/dist/server/keyphrases/cleanupHook.js.map +1 -0
- package/dist/server/keyphrases/collection.d.ts +3 -0
- package/dist/server/keyphrases/collection.d.ts.map +1 -0
- package/dist/server/keyphrases/collection.js +27 -0
- package/dist/server/keyphrases/collection.js.map +1 -0
- package/dist/server/keyphrases/docRef.d.ts +3 -0
- package/dist/server/keyphrases/docRef.d.ts.map +1 -0
- package/dist/server/keyphrases/docRef.js +16 -0
- package/dist/server/keyphrases/docRef.js.map +1 -0
- package/dist/server/keyphrases/endpoints.d.ts +4 -0
- package/dist/server/keyphrases/endpoints.d.ts.map +1 -0
- package/dist/server/keyphrases/endpoints.js +111 -0
- package/dist/server/keyphrases/endpoints.js.map +1 -0
- package/dist/server/keyphrases/rows.d.ts +8 -0
- package/dist/server/keyphrases/rows.d.ts.map +1 -0
- package/dist/server/keyphrases/rows.js +50 -0
- package/dist/server/keyphrases/rows.js.map +1 -0
- package/dist/server/keyphrases/types.d.ts +16 -0
- package/dist/server/keyphrases/types.d.ts.map +1 -0
- package/dist/server/keyphrases/types.js +1 -0
- package/dist/server/keyphrases/types.js.map +1 -0
- package/dist/server/keyphrases/withKeyphraseIndex.d.ts +4 -0
- package/dist/server/keyphrases/withKeyphraseIndex.d.ts.map +1 -0
- package/dist/server/keyphrases/withKeyphraseIndex.js +41 -0
- package/dist/server/keyphrases/withKeyphraseIndex.js.map +1 -0
- package/dist/server/links/endpoint.d.ts +4 -0
- package/dist/server/links/endpoint.d.ts.map +1 -0
- package/dist/server/links/endpoint.js +85 -0
- package/dist/server/links/endpoint.js.map +1 -0
- package/dist/server/links/findLinkCandidates.d.ts +10 -0
- package/dist/server/links/findLinkCandidates.d.ts.map +1 -0
- package/dist/server/links/findLinkCandidates.js +121 -0
- package/dist/server/links/findLinkCandidates.js.map +1 -0
- package/dist/server/links/request.d.ts +11 -0
- package/dist/server/links/request.d.ts.map +1 -0
- package/dist/server/links/request.js +54 -0
- package/dist/server/links/request.js.map +1 -0
- package/dist/server/links/resolveLinkTargets.d.ts +5 -0
- package/dist/server/links/resolveLinkTargets.d.ts.map +1 -0
- package/dist/server/links/resolveLinkTargets.js +35 -0
- package/dist/server/links/resolveLinkTargets.js.map +1 -0
- package/dist/server/links/snippet.d.ts +10 -0
- package/dist/server/links/snippet.d.ts.map +1 -0
- package/dist/server/links/snippet.js +38 -0
- package/dist/server/links/snippet.js.map +1 -0
- package/dist/server/links/sourceRows.d.ts +5 -0
- package/dist/server/links/sourceRows.d.ts.map +1 -0
- package/dist/server/links/sourceRows.js +24 -0
- package/dist/server/links/sourceRows.js.map +1 -0
- package/dist/server/links/toLinkSources.d.ts +4 -0
- package/dist/server/links/toLinkSources.d.ts.map +1 -0
- package/dist/server/links/toLinkSources.js +11 -0
- package/dist/server/links/toLinkSources.js.map +1 -0
- package/dist/translations/index.d.ts +9 -0
- package/dist/translations/index.d.ts.map +1 -0
- package/dist/translations/index.js +27 -0
- package/dist/translations/index.js.map +1 -0
- package/dist/translations/messages/cs.d.ts +3 -0
- package/dist/translations/messages/cs.d.ts.map +1 -0
- package/dist/translations/messages/cs.js +217 -0
- package/dist/translations/messages/cs.js.map +1 -0
- package/dist/translations/messages/en.d.ts +208 -0
- package/dist/translations/messages/en.d.ts.map +1 -0
- package/dist/translations/messages/en.js +211 -0
- package/dist/translations/messages/en.js.map +1 -0
- package/dist/translations/translate.d.ts +7 -0
- package/dist/translations/translate.d.ts.map +1 -0
- package/dist/translations/translate.js +43 -0
- package/dist/translations/translate.js.map +1 -0
- package/dist/translations/types.d.ts +17 -1
- package/dist/translations/types.d.ts.map +1 -1
- package/dist/translations/useSeoTranslation.d.ts +6 -0
- package/dist/translations/useSeoTranslation.d.ts.map +1 -0
- package/dist/translations/useSeoTranslation.js +15 -0
- package/dist/translations/useSeoTranslation.js.map +1 -0
- package/dist/types/config.d.ts +9 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/ui/CheckRow/CheckVisualization/visualizations/DistributionBar.d.ts.map +1 -1
- package/dist/ui/CheckRow/CheckVisualization/visualizations/DistributionBar.js +5 -3
- package/dist/ui/CheckRow/CheckVisualization/visualizations/DistributionBar.js.map +1 -1
- package/dist/ui/CheckRow/CheckVisualization/visualizations/DrillDown.d.ts +1 -1
- package/dist/ui/CheckRow/CheckVisualization/visualizations/DrillDown.d.ts.map +1 -1
- package/dist/ui/CheckRow/CheckVisualization/visualizations/DrillDown.js +6 -3
- package/dist/ui/CheckRow/CheckVisualization/visualizations/DrillDown.js.map +1 -1
- package/dist/ui/CheckRow/CheckVisualization/visualizations/SegmentBar.d.ts.map +1 -1
- package/dist/ui/CheckRow/CheckVisualization/visualizations/SegmentBar.js +4 -2
- package/dist/ui/CheckRow/CheckVisualization/visualizations/SegmentBar.js.map +1 -1
- package/dist/ui/CheckRow/index.d.ts.map +1 -1
- package/dist/ui/CheckRow/index.js +8 -8
- package/dist/ui/CheckRow/index.js.map +1 -1
- package/dist/ui/FilterPills.d.ts.map +1 -1
- package/dist/ui/FilterPills.js +6 -4
- package/dist/ui/FilterPills.js.map +1 -1
- package/dist/ui/Notice.d.ts +7 -0
- package/dist/ui/Notice.d.ts.map +1 -0
- package/dist/ui/Notice.js +26 -0
- package/dist/ui/Notice.js.map +1 -0
- package/dist/ui/TabHeader.d.ts.map +1 -1
- package/dist/ui/TabHeader.js +4 -2
- package/dist/ui/TabHeader.js.map +1 -1
- package/dist/utils/config/mergeTranslations.d.ts +3 -2
- package/dist/utils/config/mergeTranslations.d.ts.map +1 -1
- package/dist/utils/config/mergeTranslations.js +10 -2
- package/dist/utils/config/mergeTranslations.js.map +1 -1
- package/dist/utils/config/overrideAdmin.d.ts.map +1 -1
- package/dist/utils/config/overrideAdmin.js +2 -1
- package/dist/utils/config/overrideAdmin.js.map +1 -1
- package/dist/utils/style.d.ts +1 -0
- package/dist/utils/style.d.ts.map +1 -1
- package/dist/utils/style.js +4 -0
- package/dist/utils/style.js.map +1 -1
- package/package.json +1 -1
- package/dist/engine/visualization/resolveVisualization/utils/pluralize.d.ts +0 -2
- package/dist/engine/visualization/resolveVisualization/utils/pluralize.d.ts.map +0 -1
- package/dist/engine/visualization/resolveVisualization/utils/pluralize.js +0 -5
- package/dist/engine/visualization/resolveVisualization/utils/pluralize.js.map +0 -1
- package/dist/translations/en.d.ts +0 -3
- package/dist/translations/en.d.ts.map +0 -1
- package/dist/translations/en.js +0 -17
- package/dist/translations/en.js.map +0 -1
- package/dist/ui/CheckRow/constants/labels.d.ts +0 -6
- package/dist/ui/CheckRow/constants/labels.d.ts.map +0 -1
- package/dist/ui/CheckRow/constants/labels.js +0 -103
- package/dist/ui/CheckRow/constants/labels.js.map +0 -1
|
@@ -2,30 +2,30 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Plus } from "lucide-react";
|
|
4
4
|
import { MAX_KEYPHRASES } from "../../../../constants";
|
|
5
|
+
import { Notice } from "../../../../ui/Notice";
|
|
5
6
|
import { KeyphraseCard } from "./KeyphraseCard";
|
|
7
|
+
import { useSeoTranslation } from "../../../../translations/useSeoTranslation";
|
|
6
8
|
function KeyphraseRail({
|
|
7
9
|
entries,
|
|
8
10
|
selectedId,
|
|
9
11
|
stateFor,
|
|
10
12
|
onSelect,
|
|
11
|
-
onAdd
|
|
13
|
+
onAdd,
|
|
14
|
+
saveFailed = false,
|
|
15
|
+
readOnly = false
|
|
12
16
|
}) {
|
|
17
|
+
const { t } = useSeoTranslation();
|
|
13
18
|
const atMax = entries.length >= MAX_KEYPHRASES;
|
|
14
19
|
return /* @__PURE__ */ jsx("aside", { className: "frseo:w-[264px] frseo:flex-none frseo:border-r frseo:border-neutral-200 frseo:bg-neutral-50", children: /* @__PURE__ */ jsxs("div", { className: "frseo:sticky frseo:top-0 frseo:px-[9px] frseo:py-[18px] frseo:flex frseo:flex-col frseo:gap-[5px]", children: [
|
|
15
20
|
/* @__PURE__ */ jsxs("div", { className: "frseo:flex frseo:items-center frseo:justify-between frseo:px-[7px] frseo:pt-[5px] frseo:pb-[3px]", children: [
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
"Keyphrases \xB7 ",
|
|
18
|
-
entries.length,
|
|
19
|
-
"/",
|
|
20
|
-
MAX_KEYPHRASES
|
|
21
|
-
] }),
|
|
21
|
+
/* @__PURE__ */ jsx("span", { className: "frseo:text-[10px] frseo:uppercase frseo:tracking-[0.05em] frseo:text-neutral-500 frseo:font-bold", children: t("keyphrase.rail", { count: entries.length, max: MAX_KEYPHRASES }) }),
|
|
22
22
|
/* @__PURE__ */ jsx(
|
|
23
23
|
"button",
|
|
24
24
|
{
|
|
25
25
|
type: "button",
|
|
26
|
-
"aria-label": "
|
|
27
|
-
title: atMax ?
|
|
28
|
-
disabled: atMax,
|
|
26
|
+
"aria-label": t("keyphrase.add"),
|
|
27
|
+
title: atMax ? t("keyphrase.max", { max: MAX_KEYPHRASES }) : t("keyphrase.add"),
|
|
28
|
+
disabled: readOnly || atMax,
|
|
29
29
|
onClick: onAdd,
|
|
30
30
|
className: "frseo:w-[26px] frseo:h-[26px] frseo:rounded-rs frseo:border frseo:border-neutral-200 frseo:grid frseo:place-items-center frseo:text-neutral-600 frseo:bg-neutral-0 frseo:hover:border-neutral-800 frseo:hover:text-neutral-800 frseo:disabled:opacity-35 frseo:not-disabled:cursor-pointer frseo:disabled:cursor-not-allowed frseo:[&_svg]:size-[15px]",
|
|
31
31
|
children: /* @__PURE__ */ jsx(Plus, { "aria-hidden": "true" })
|
|
@@ -42,7 +42,8 @@ function KeyphraseRail({
|
|
|
42
42
|
onSelect
|
|
43
43
|
},
|
|
44
44
|
entry.id
|
|
45
|
-
))
|
|
45
|
+
)),
|
|
46
|
+
saveFailed && /* @__PURE__ */ jsx(Notice, { className: "frseo:mt-[6px]", role: "alert", variant: "bad", children: t("keyphrase.saveFailed") })
|
|
46
47
|
] }) });
|
|
47
48
|
}
|
|
48
49
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/SeoDrawer/tabs/keyphrase/KeyphraseRail.tsx"],"sourcesContent":["\"use client\";\n\nimport { Plus } from \"lucide-react\";\nimport { MAX_KEYPHRASES } from \"../../../../constants\";\nimport type { KeyphraseEntry } from \"../../keyphraseState\";\nimport { KeyphraseCard } from \"./KeyphraseCard\";\nimport type { CardState } from \"./KeyphraseCard\";\n\ninterface KeyphraseRailProps {\n entries: KeyphraseEntry[];\n selectedId: string | null;\n stateFor: (entry: KeyphraseEntry) => CardState;\n onSelect: (id: string) => void;\n onAdd: () => void;\n}\n\nexport function KeyphraseRail({\n entries,\n selectedId,\n stateFor,\n onSelect,\n onAdd,\n}: KeyphraseRailProps) {\n const atMax = entries.length >= MAX_KEYPHRASES;\n\n return (\n <aside className=\"w-[264px] flex-none border-r border-neutral-200 bg-neutral-50\">\n <div className=\"sticky top-0 px-[9px] py-[18px] flex flex-col gap-[5px]\">\n <div className=\"flex items-center justify-between px-[7px] pt-[5px] pb-[3px]\">\n <span className=\"text-[10px] uppercase tracking-[0.05em] text-neutral-500 font-bold\">\n
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/SeoDrawer/tabs/keyphrase/KeyphraseRail.tsx"],"sourcesContent":["\"use client\";\n\nimport { Plus } from \"lucide-react\";\nimport { MAX_KEYPHRASES } from \"../../../../constants\";\nimport { Notice } from \"../../../../ui/Notice\";\nimport type { KeyphraseEntry } from \"../../keyphraseState\";\nimport { KeyphraseCard } from \"./KeyphraseCard\";\nimport type { CardState } from \"./KeyphraseCard\";\nimport { useSeoTranslation } from \"../../../../translations/useSeoTranslation\";\n\ninterface KeyphraseRailProps {\n entries: KeyphraseEntry[];\n selectedId: string | null;\n stateFor: (entry: KeyphraseEntry) => CardState;\n onSelect: (id: string) => void;\n onAdd: () => void;\n saveFailed?: boolean;\n readOnly?: boolean;\n}\n\nexport function KeyphraseRail({\n entries,\n selectedId,\n stateFor,\n onSelect,\n onAdd,\n saveFailed = false,\n readOnly = false,\n}: KeyphraseRailProps) {\n const { t } = useSeoTranslation();\n const atMax = entries.length >= MAX_KEYPHRASES;\n\n return (\n <aside className=\"w-[264px] flex-none border-r border-neutral-200 bg-neutral-50\">\n <div className=\"sticky top-0 px-[9px] py-[18px] flex flex-col gap-[5px]\">\n <div className=\"flex items-center justify-between px-[7px] pt-[5px] pb-[3px]\">\n <span className=\"text-[10px] uppercase tracking-[0.05em] text-neutral-500 font-bold\">\n {t(\"keyphrase.rail\", { count: entries.length, max: MAX_KEYPHRASES })}\n </span>\n\n <button\n type=\"button\"\n aria-label={t(\"keyphrase.add\")}\n title={atMax ? t(\"keyphrase.max\", { max: MAX_KEYPHRASES }) : t(\"keyphrase.add\")}\n disabled={readOnly || atMax}\n onClick={onAdd}\n className=\"w-[26px] h-[26px] rounded-rs border border-neutral-200 grid place-items-center text-neutral-600 bg-neutral-0 hover:border-neutral-800 hover:text-neutral-800 disabled:opacity-35 not-disabled:cursor-pointer disabled:cursor-not-allowed [&_svg]:size-[15px]\"\n >\n <Plus aria-hidden=\"true\" />\n </button>\n </div>\n\n {entries.map((entry, i) => (\n <KeyphraseCard\n key={entry.id}\n entry={entry}\n isFocus={i === 0}\n selected={entry.id === selectedId}\n state={stateFor(entry)}\n onSelect={onSelect}\n />\n ))}\n\n {saveFailed && (\n <Notice className=\"mt-[6px]\" role=\"alert\" variant=\"bad\">\n {t(\"keyphrase.saveFailed\")}\n </Notice>\n )}\n </div>\n </aside>\n );\n}\n"],"mappings":";AAmCQ,SACE,KADF;AAjCR,SAAS,YAAY;AACrB,SAAS,sBAAsB;AAC/B,SAAS,cAAc;AAEvB,SAAS,qBAAqB;AAE9B,SAAS,yBAAyB;AAY3B,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,WAAW;AACb,GAAuB;AACrB,QAAM,EAAE,EAAE,IAAI,kBAAkB;AAChC,QAAM,QAAQ,QAAQ,UAAU;AAEhC,SACE,oBAAC,WAAM,WAAU,iEACf,+BAAC,SAAI,WAAU,2DACb;AAAA,yBAAC,SAAI,WAAU,gEACb;AAAA,0BAAC,UAAK,WAAU,sEACb,YAAE,kBAAkB,EAAE,OAAO,QAAQ,QAAQ,KAAK,eAAe,CAAC,GACrE;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,cAAY,EAAE,eAAe;AAAA,UAC7B,OAAO,QAAQ,EAAE,iBAAiB,EAAE,KAAK,eAAe,CAAC,IAAI,EAAE,eAAe;AAAA,UAC9E,UAAU,YAAY;AAAA,UACtB,SAAS;AAAA,UACT,WAAU;AAAA,UAEV,8BAAC,QAAK,eAAY,QAAO;AAAA;AAAA,MAC3B;AAAA,OACF;AAAA,IAEC,QAAQ,IAAI,CAAC,OAAO,MACnB;AAAA,MAAC;AAAA;AAAA,QAEC;AAAA,QACA,SAAS,MAAM;AAAA,QACf,UAAU,MAAM,OAAO;AAAA,QACvB,OAAO,SAAS,KAAK;AAAA,QACrB;AAAA;AAAA,MALK,MAAM;AAAA,IAMb,CACD;AAAA,IAEA,cACC,oBAAC,UAAO,WAAU,YAAW,MAAK,SAAQ,SAAQ,OAC/C,YAAE,sBAAsB,GAC3B;AAAA,KAEJ,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface KeyphraseUsageProps {
|
|
2
|
+
collectionSlug: string;
|
|
3
|
+
docId: string;
|
|
4
|
+
phrase: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function KeyphraseUsageNotice({ collectionSlug, docId, phrase }: KeyphraseUsageProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export declare function KeyphraseUsage({ phrase }: Pick<KeyphraseUsageProps, "phrase">): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
//# sourceMappingURL=KeyphraseUsageNotice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyphraseUsageNotice.d.ts","sourceRoot":"","sources":["../../../../../src/components/SeoDrawer/tabs/keyphrase/KeyphraseUsageNotice.tsx"],"names":[],"mappings":"AAaA,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,oBAAoB,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,mBAAmB,kDAyC1F;AAED,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,kDAS7E"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useConfig, useDebounce, useDocumentInfo, usePayloadAPI } from "@payloadcms/ui";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { KEYPHRASE_USAGE_ENDPOINT_PATH } from "../../../../constants";
|
|
6
|
+
import { docTargetKey } from "../../../../keyphrases/docTarget";
|
|
7
|
+
import { adminDocHref } from "../../../../keyphrases/usage";
|
|
8
|
+
import { useSeoTranslation } from "../../../../translations/useSeoTranslation";
|
|
9
|
+
import { Notice } from "../../../../ui/Notice";
|
|
10
|
+
const USAGE_DEBOUNCE_MS = 400;
|
|
11
|
+
function KeyphraseUsageNotice({ collectionSlug, docId, phrase }) {
|
|
12
|
+
const { config } = useConfig();
|
|
13
|
+
const { t } = useSeoTranslation();
|
|
14
|
+
const params = { collection: collectionSlug, docId, phrase };
|
|
15
|
+
const [{ data, isError }, { setParams }] = usePayloadAPI(
|
|
16
|
+
`${config.routes.api}${KEYPHRASE_USAGE_ENDPOINT_PATH}`,
|
|
17
|
+
{ initialParams: params }
|
|
18
|
+
);
|
|
19
|
+
const [requestedPhrase, setRequestedPhrase] = useState(phrase);
|
|
20
|
+
if (requestedPhrase !== phrase) {
|
|
21
|
+
setRequestedPhrase(phrase);
|
|
22
|
+
setParams(params);
|
|
23
|
+
}
|
|
24
|
+
const docs = data?.docs ?? [];
|
|
25
|
+
if (isError || docs.length === 0)
|
|
26
|
+
return null;
|
|
27
|
+
return /* @__PURE__ */ jsx(Notice, { "aria-live": "polite", role: "status", variant: "warn", children: /* @__PURE__ */ jsxs("div", { className: "frseo:flex frseo:flex-col frseo:gap-[4px]", children: [
|
|
28
|
+
/* @__PURE__ */ jsx("span", { children: t("keyphrase.usedOn") }),
|
|
29
|
+
/* @__PURE__ */ jsx("ul", { className: "frseo:m-0 frseo:pl-[16px]", children: docs.map((doc) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
30
|
+
"a",
|
|
31
|
+
{
|
|
32
|
+
className: "frseo:text-inherit frseo:underline",
|
|
33
|
+
href: adminDocHref(config.routes.admin, doc),
|
|
34
|
+
rel: "noopener noreferrer",
|
|
35
|
+
target: "_blank",
|
|
36
|
+
children: doc.title
|
|
37
|
+
}
|
|
38
|
+
) }, docTargetKey(doc.collection, doc.id))) }),
|
|
39
|
+
/* @__PURE__ */ jsx("span", { children: t("keyphrase.cannibalization") })
|
|
40
|
+
] }) });
|
|
41
|
+
}
|
|
42
|
+
function KeyphraseUsage({ phrase }) {
|
|
43
|
+
const { collectionSlug, id } = useDocumentInfo();
|
|
44
|
+
const debounced = useDebounce(phrase.trim(), USAGE_DEBOUNCE_MS);
|
|
45
|
+
if (!debounced || !collectionSlug)
|
|
46
|
+
return null;
|
|
47
|
+
return /* @__PURE__ */ jsx(KeyphraseUsageNotice, { collectionSlug, docId: String(id), phrase: debounced });
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
KeyphraseUsage,
|
|
51
|
+
KeyphraseUsageNotice
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=KeyphraseUsageNotice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/SeoDrawer/tabs/keyphrase/KeyphraseUsageNotice.tsx"],"sourcesContent":["\"use client\";\n\nimport { useConfig, useDebounce, useDocumentInfo, usePayloadAPI } from \"@payloadcms/ui\";\nimport { useState } from \"react\";\nimport { KEYPHRASE_USAGE_ENDPOINT_PATH } from \"../../../../constants\";\nimport { docTargetKey } from \"../../../../keyphrases/docTarget\";\nimport { adminDocHref } from \"../../../../keyphrases/usage\";\nimport type { UsageDoc } from \"../../../../keyphrases/usage\";\nimport { useSeoTranslation } from \"../../../../translations/useSeoTranslation\";\nimport { Notice } from \"../../../../ui/Notice\";\n\nconst USAGE_DEBOUNCE_MS = 400;\n\nexport interface KeyphraseUsageProps {\n collectionSlug: string;\n docId: string;\n phrase: string;\n}\n\nexport function KeyphraseUsageNotice({ collectionSlug, docId, phrase }: KeyphraseUsageProps) {\n const { config } = useConfig();\n const { t } = useSeoTranslation();\n const params = { collection: collectionSlug, docId, phrase };\n const [{ data, isError }, { setParams }] = usePayloadAPI(\n `${config.routes.api}${KEYPHRASE_USAGE_ENDPOINT_PATH}`,\n { initialParams: params }\n );\n const [requestedPhrase, setRequestedPhrase] = useState(phrase);\n\n if (requestedPhrase !== phrase) {\n setRequestedPhrase(phrase);\n setParams(params);\n }\n\n const docs: UsageDoc[] = data?.docs ?? [];\n\n if (isError || docs.length === 0) return null;\n\n return (\n <Notice aria-live=\"polite\" role=\"status\" variant=\"warn\">\n <div className=\"flex flex-col gap-[4px]\">\n <span>{t(\"keyphrase.usedOn\")}</span>\n <ul className=\"m-0 pl-[16px]\">\n {docs.map((doc) => (\n <li key={docTargetKey(doc.collection, doc.id)}>\n <a\n className=\"text-inherit underline\"\n href={adminDocHref(config.routes.admin, doc)}\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n >\n {doc.title}\n </a>\n </li>\n ))}\n </ul>\n <span>{t(\"keyphrase.cannibalization\")}</span>\n </div>\n </Notice>\n );\n}\n\nexport function KeyphraseUsage({ phrase }: Pick<KeyphraseUsageProps, \"phrase\">) {\n const { collectionSlug, id } = useDocumentInfo();\n const debounced = useDebounce(phrase.trim(), USAGE_DEBOUNCE_MS);\n\n if (!debounced || !collectionSlug) return null;\n\n return (\n <KeyphraseUsageNotice collectionSlug={collectionSlug} docId={String(id)} phrase={debounced} />\n );\n}\n"],"mappings":";AAwCM,SACE,KADF;AAtCN,SAAS,WAAW,aAAa,iBAAiB,qBAAqB;AACvE,SAAS,gBAAgB;AACzB,SAAS,qCAAqC;AAC9C,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAE7B,SAAS,yBAAyB;AAClC,SAAS,cAAc;AAEvB,MAAM,oBAAoB;AAQnB,SAAS,qBAAqB,EAAE,gBAAgB,OAAO,OAAO,GAAwB;AAC3F,QAAM,EAAE,OAAO,IAAI,UAAU;AAC7B,QAAM,EAAE,EAAE,IAAI,kBAAkB;AAChC,QAAM,SAAS,EAAE,YAAY,gBAAgB,OAAO,OAAO;AAC3D,QAAM,CAAC,EAAE,MAAM,QAAQ,GAAG,EAAE,UAAU,CAAC,IAAI;AAAA,IACzC,GAAG,OAAO,OAAO,GAAG,GAAG,6BAA6B;AAAA,IACpD,EAAE,eAAe,OAAO;AAAA,EAC1B;AACA,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,SAAS,MAAM;AAE7D,MAAI,oBAAoB,QAAQ;AAC9B,uBAAmB,MAAM;AACzB,cAAU,MAAM;AAAA,EAClB;AAEA,QAAM,OAAmB,MAAM,QAAQ,CAAC;AAExC,MAAI,WAAW,KAAK,WAAW;AAAG,WAAO;AAEzC,SACE,oBAAC,UAAO,aAAU,UAAS,MAAK,UAAS,SAAQ,QAC/C,+BAAC,SAAI,WAAU,2BACb;AAAA,wBAAC,UAAM,YAAE,kBAAkB,GAAE;AAAA,IAC7B,oBAAC,QAAG,WAAU,iBACX,eAAK,IAAI,CAAC,QACT,oBAAC,QACC;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,MAAM,aAAa,OAAO,OAAO,OAAO,GAAG;AAAA,QAC3C,KAAI;AAAA,QACJ,QAAO;AAAA,QAEN,cAAI;AAAA;AAAA,IACP,KARO,aAAa,IAAI,YAAY,IAAI,EAAE,CAS5C,CACD,GACH;AAAA,IACA,oBAAC,UAAM,YAAE,2BAA2B,GAAE;AAAA,KACxC,GACF;AAEJ;AAEO,SAAS,eAAe,EAAE,OAAO,GAAwC;AAC9E,QAAM,EAAE,gBAAgB,GAAG,IAAI,gBAAgB;AAC/C,QAAM,YAAY,YAAY,OAAO,KAAK,GAAG,iBAAiB;AAE9D,MAAI,CAAC,aAAa,CAAC;AAAgB,WAAO;AAE1C,SACE,oBAAC,wBAAqB,gBAAgC,OAAO,OAAO,EAAE,GAAG,QAAQ,WAAW;AAEhG;","names":[]}
|
|
@@ -2,6 +2,7 @@ export interface SynonymsFieldProps {
|
|
|
2
2
|
synonyms: string[];
|
|
3
3
|
onAdd: (syn: string) => void;
|
|
4
4
|
onRemove: (index: number) => void;
|
|
5
|
+
readOnly?: boolean;
|
|
5
6
|
}
|
|
6
|
-
export declare function SynonymsField({ synonyms, onAdd, onRemove }: SynonymsFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function SynonymsField({ synonyms, onAdd, onRemove, readOnly }: SynonymsFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
//# sourceMappingURL=SynonymsField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SynonymsField.d.ts","sourceRoot":"","sources":["../../../../../src/components/SeoDrawer/tabs/keyphrase/SynonymsField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SynonymsField.d.ts","sourceRoot":"","sources":["../../../../../src/components/SeoDrawer/tabs/keyphrase/SynonymsField.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAgB,EAAE,EAAE,kBAAkB,2CAsFhG"}
|
|
@@ -3,7 +3,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Plus, X } from "lucide-react";
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import { cn } from "../../../../utils/style";
|
|
6
|
-
|
|
6
|
+
import { useSeoTranslation } from "../../../../translations/useSeoTranslation";
|
|
7
|
+
function SynonymsField({ synonyms, onAdd, onRemove, readOnly = false }) {
|
|
8
|
+
const { t } = useSeoTranslation();
|
|
7
9
|
const [draft, setDraft] = useState("");
|
|
8
10
|
const [focused, setFocused] = useState(false);
|
|
9
11
|
const canAdd = draft.trim().length > 0;
|
|
@@ -14,7 +16,7 @@ function SynonymsField({ synonyms, onAdd, onRemove }) {
|
|
|
14
16
|
setDraft("");
|
|
15
17
|
};
|
|
16
18
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
17
|
-
/* @__PURE__ */ jsx("span", { className: "frseo:block frseo:text-[10px] frseo:uppercase frseo:tracking-[0.05em] frseo:text-neutral-500 frseo:mb-[6px]", children: "
|
|
19
|
+
/* @__PURE__ */ jsx("span", { className: "frseo:block frseo:text-[10px] frseo:uppercase frseo:tracking-[0.05em] frseo:text-neutral-500 frseo:mb-[6px]", children: t("synonyms.title") }),
|
|
18
20
|
/* @__PURE__ */ jsxs(
|
|
19
21
|
"div",
|
|
20
22
|
{
|
|
@@ -30,11 +32,11 @@ function SynonymsField({ synonyms, onAdd, onRemove }) {
|
|
|
30
32
|
className: "frseo:bg-neutral-1000 frseo:text-neutral-0 frseo:rounded-[15px] frseo:pl-[12px] frseo:pr-[6px] frseo:py-[4px] frseo:text-[11.5px] frseo:inline-flex frseo:items-center frseo:gap-[7px]",
|
|
31
33
|
children: [
|
|
32
34
|
synonym,
|
|
33
|
-
/* @__PURE__ */ jsx(
|
|
35
|
+
!readOnly && /* @__PURE__ */ jsx(
|
|
34
36
|
"button",
|
|
35
37
|
{
|
|
36
38
|
type: "button",
|
|
37
|
-
"aria-label":
|
|
39
|
+
"aria-label": t("synonyms.remove", { synonym, position: index + 1 }),
|
|
38
40
|
className: "frseo:grid frseo:place-items-center frseo:p-0.5 frseo:text-neutral-400 frseo:rounded-full frseo:bg-transparent frseo:hover:text-neutral-0 frseo:hover:bg-neutral-800 frseo:[&_svg]:size-[1em] frseo:cursor-pointer",
|
|
39
41
|
onClick: () => onRemove(index),
|
|
40
42
|
children: /* @__PURE__ */ jsx(X, { "aria-hidden": "true" })
|
|
@@ -48,7 +50,7 @@ function SynonymsField({ synonyms, onAdd, onRemove }) {
|
|
|
48
50
|
"button",
|
|
49
51
|
{
|
|
50
52
|
type: "button",
|
|
51
|
-
disabled: !canAdd,
|
|
53
|
+
disabled: readOnly || !canAdd,
|
|
52
54
|
onClick: commit,
|
|
53
55
|
className: cn(
|
|
54
56
|
"frseo:inline-flex frseo:items-center frseo:gap-[5px] frseo:rounded-[15px] frseo:px-[11px] frseo:py-[5px] frseo:text-[11.5px] frseo:font-semibold frseo:[&_svg]:size-[13px] frseo:not-disabled:cursor-pointer frseo:transition-colors frseo:duration-150",
|
|
@@ -57,7 +59,8 @@ function SynonymsField({ synonyms, onAdd, onRemove }) {
|
|
|
57
59
|
),
|
|
58
60
|
children: [
|
|
59
61
|
/* @__PURE__ */ jsx(Plus, { "aria-hidden": "true" }),
|
|
60
|
-
"
|
|
62
|
+
" ",
|
|
63
|
+
t("synonyms.add")
|
|
61
64
|
]
|
|
62
65
|
}
|
|
63
66
|
)
|
|
@@ -78,17 +81,18 @@ function SynonymsField({ synonyms, onAdd, onRemove }) {
|
|
|
78
81
|
commit();
|
|
79
82
|
}
|
|
80
83
|
},
|
|
81
|
-
placeholder: "
|
|
82
|
-
"aria-label": "
|
|
84
|
+
placeholder: t("synonyms.placeholder"),
|
|
85
|
+
"aria-label": t("synonyms.inputLabel"),
|
|
86
|
+
disabled: readOnly,
|
|
83
87
|
className: "frseo:flex-1 frseo:border-0 frseo:outline-none frseo:text-[12.5px] frseo:text-neutral-800 frseo:bg-transparent"
|
|
84
88
|
}
|
|
85
89
|
),
|
|
86
|
-
/* @__PURE__ */ jsx("span", { className: "frseo:text-[9px] frseo:text-neutral-500 frseo:border frseo:border-neutral-200 frseo:rounded-[4px] frseo:px-[5px] frseo:py-[1px] frseo:font-semibold", children: "
|
|
90
|
+
/* @__PURE__ */ jsx("span", { className: "frseo:text-[9px] frseo:text-neutral-500 frseo:border frseo:border-neutral-200 frseo:rounded-[4px] frseo:px-[5px] frseo:py-[1px] frseo:font-semibold", children: t("synonyms.enter") })
|
|
87
91
|
] })
|
|
88
92
|
]
|
|
89
93
|
}
|
|
90
94
|
),
|
|
91
|
-
/* @__PURE__ */ jsx("div", { className: "frseo:text-[11px] frseo:text-neutral-500 frseo:mt-[6px] frseo:leading-[1.45]", children: "
|
|
95
|
+
/* @__PURE__ */ jsx("div", { className: "frseo:text-[11px] frseo:text-neutral-500 frseo:mt-[6px] frseo:leading-[1.45]", children: t("synonyms.help") })
|
|
92
96
|
] });
|
|
93
97
|
}
|
|
94
98
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/SeoDrawer/tabs/keyphrase/SynonymsField.tsx"],"sourcesContent":["\"use client\";\n\nimport { Plus, X } from \"lucide-react\";\nimport { useState } from \"react\";\nimport { cn } from \"../../../../utils/style\";\n\nexport interface SynonymsFieldProps {\n synonyms: string[];\n onAdd: (syn: string) => void;\n onRemove: (index: number) => void;\n}\n\nexport function SynonymsField({ synonyms, onAdd, onRemove }: SynonymsFieldProps) {\n const [draft, setDraft] = useState(\"\");\n const [focused, setFocused] = useState(false);\n const canAdd = draft.trim().length > 0;\n\n const commit = () => {\n if (!canAdd) return;\n onAdd(draft.trim());\n setDraft(\"\");\n };\n\n return (\n <div>\n <span className=\"block text-[10px] uppercase tracking-[0.05em] text-neutral-500 mb-[6px]\">\n
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/SeoDrawer/tabs/keyphrase/SynonymsField.tsx"],"sourcesContent":["\"use client\";\n\nimport { Plus, X } from \"lucide-react\";\nimport { useState } from \"react\";\nimport { cn } from \"../../../../utils/style\";\nimport { useSeoTranslation } from \"../../../../translations/useSeoTranslation\";\n\nexport interface SynonymsFieldProps {\n synonyms: string[];\n onAdd: (syn: string) => void;\n onRemove: (index: number) => void;\n readOnly?: boolean;\n}\n\nexport function SynonymsField({ synonyms, onAdd, onRemove, readOnly = false }: SynonymsFieldProps) {\n const { t } = useSeoTranslation();\n const [draft, setDraft] = useState(\"\");\n const [focused, setFocused] = useState(false);\n const canAdd = draft.trim().length > 0;\n\n const commit = () => {\n if (!canAdd) return;\n onAdd(draft.trim());\n setDraft(\"\");\n };\n\n return (\n <div>\n <span className=\"block text-[10px] uppercase tracking-[0.05em] text-neutral-500 mb-[6px]\">\n {t(\"synonyms.title\")}\n </span>\n\n <div\n className={cn(\n \"border rounded-rs bg-neutral-0 overflow-hidden\",\n focused ? \"border-neutral-800\" : \"border-neutral-200\"\n )}\n >\n <div className=\"flex flex-wrap gap-[7px] p-[9px] items-center\">\n {synonyms.map((synonym, index) => (\n <span\n key={`${synonym}-${index}`}\n className=\"bg-neutral-1000 text-neutral-0 rounded-[15px] pl-[12px] pr-[6px] py-[4px] text-[11.5px] inline-flex items-center gap-[7px]\"\n >\n {synonym}\n\n {!readOnly && (\n <button\n type=\"button\"\n aria-label={t(\"synonyms.remove\", { synonym, position: index + 1 })}\n className=\"grid place-items-center p-0.5 text-neutral-400 rounded-full bg-transparent hover:text-neutral-0 hover:bg-neutral-800 [&_svg]:size-[1em] cursor-pointer\"\n onClick={() => onRemove(index)}\n >\n <X aria-hidden=\"true\" />\n </button>\n )}\n </span>\n ))}\n <button\n type=\"button\"\n disabled={readOnly || !canAdd}\n onClick={commit}\n className={cn(\n \"inline-flex items-center gap-[5px] rounded-[15px] px-[11px] py-[5px] text-[11.5px] font-semibold [&_svg]:size-[13px] not-disabled:cursor-pointer transition-colors duration-150\",\n \"bg-neutral-1000 text-neutral-0 not-disabled:hover:bg-neutral-800\",\n \"disabled:bg-neutral-100 disabled:text-neutral-300 disabled:cursor-not-allowed disabled:transition-none\"\n )}\n >\n <Plus aria-hidden=\"true\" /> {t(\"synonyms.add\")}\n </button>\n </div>\n <div className=\"border-t border-neutral-150\" />\n <div className=\"flex items-center gap-[8px] px-[11px] py-[8px]\">\n <input\n type=\"text\"\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n onFocus={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n commit();\n }\n }}\n placeholder={t(\"synonyms.placeholder\")}\n aria-label={t(\"synonyms.inputLabel\")}\n disabled={readOnly}\n className=\"flex-1 border-0 outline-none text-[12.5px] text-neutral-800 bg-transparent\"\n />\n <span className=\"text-[9px] text-neutral-500 border border-neutral-200 rounded-[4px] px-[5px] py-[1px] font-semibold\">\n {t(\"synonyms.enter\")}\n </span>\n </div>\n </div>\n <div className=\"text-[11px] text-neutral-500 mt-[6px] leading-[1.45]\">\n {t(\"synonyms.help\")}\n </div>\n </div>\n );\n}\n"],"mappings":";AA4BM,cAYM,YAZN;AA1BN,SAAS,MAAM,SAAS;AACxB,SAAS,gBAAgB;AACzB,SAAS,UAAU;AACnB,SAAS,yBAAyB;AAS3B,SAAS,cAAc,EAAE,UAAU,OAAO,UAAU,WAAW,MAAM,GAAuB;AACjG,QAAM,EAAE,EAAE,IAAI,kBAAkB;AAChC,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,EAAE;AACrC,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAC5C,QAAM,SAAS,MAAM,KAAK,EAAE,SAAS;AAErC,QAAM,SAAS,MAAM;AACnB,QAAI,CAAC;AAAQ;AACb,UAAM,MAAM,KAAK,CAAC;AAClB,aAAS,EAAE;AAAA,EACb;AAEA,SACE,qBAAC,SACC;AAAA,wBAAC,UAAK,WAAU,2EACb,YAAE,gBAAgB,GACrB;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA,UAAU,uBAAuB;AAAA,QACnC;AAAA,QAEA;AAAA,+BAAC,SAAI,WAAU,iDACZ;AAAA,qBAAS,IAAI,CAAC,SAAS,UACtB;AAAA,cAAC;AAAA;AAAA,gBAEC,WAAU;AAAA,gBAET;AAAA;AAAA,kBAEA,CAAC,YACA;AAAA,oBAAC;AAAA;AAAA,sBACC,MAAK;AAAA,sBACL,cAAY,EAAE,mBAAmB,EAAE,SAAS,UAAU,QAAQ,EAAE,CAAC;AAAA,sBACjE,WAAU;AAAA,sBACV,SAAS,MAAM,SAAS,KAAK;AAAA,sBAE7B,8BAAC,KAAE,eAAY,QAAO;AAAA;AAAA,kBACxB;AAAA;AAAA;AAAA,cAbG,GAAG,OAAO,IAAI,KAAK;AAAA,YAe1B,CACD;AAAA,YACD;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,UAAU,YAAY,CAAC;AAAA,gBACvB,SAAS;AAAA,gBACT,WAAW;AAAA,kBACT;AAAA,kBACA;AAAA,kBACA;AAAA,gBACF;AAAA,gBAEA;AAAA,sCAAC,QAAK,eAAY,QAAO;AAAA,kBAAE;AAAA,kBAAE,EAAE,cAAc;AAAA;AAAA;AAAA,YAC/C;AAAA,aACF;AAAA,UACA,oBAAC,SAAI,WAAU,+BAA8B;AAAA,UAC7C,qBAAC,SAAI,WAAU,kDACb;AAAA;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,OAAO;AAAA,gBACP,UAAU,CAAC,MAAM,SAAS,EAAE,OAAO,KAAK;AAAA,gBACxC,SAAS,MAAM,WAAW,IAAI;AAAA,gBAC9B,QAAQ,MAAM,WAAW,KAAK;AAAA,gBAC9B,WAAW,CAAC,MAAM;AAChB,sBAAI,EAAE,QAAQ,SAAS;AACrB,sBAAE,eAAe;AACjB,2BAAO;AAAA,kBACT;AAAA,gBACF;AAAA,gBACA,aAAa,EAAE,sBAAsB;AAAA,gBACrC,cAAY,EAAE,qBAAqB;AAAA,gBACnC,UAAU;AAAA,gBACV,WAAU;AAAA;AAAA,YACZ;AAAA,YACA,oBAAC,UAAK,WAAU,uGACb,YAAE,gBAAgB,GACrB;AAAA,aACF;AAAA;AAAA;AAAA,IACF;AAAA,IACA,oBAAC,SAAI,WAAU,wDACZ,YAAE,eAAe,GACpB;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LinkSuggestion } from "../../../../links/types";
|
|
2
|
+
interface LinkSuggestionRowProps {
|
|
3
|
+
suggestion: LinkSuggestion;
|
|
4
|
+
adminHref: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function LinkSuggestionRow({ suggestion, adminHref }: LinkSuggestionRowProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=LinkSuggestionRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinkSuggestionRow.d.ts","sourceRoot":"","sources":["../../../../../src/components/SeoDrawer/tabs/links/LinkSuggestionRow.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,yBAAyB,CAAC;AAoEzE,UAAU,sBAAsB;IAC9B,UAAU,EAAE,cAAc,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,sBAAsB,2CAuClF"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Check, Copy, X } from "lucide-react";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { IconButton } from "../../../../ui/IconButton";
|
|
6
|
+
import { Pill } from "../../../../ui/Pill";
|
|
7
|
+
import { cn, ROW_SEPARATOR } from "../../../../utils/style";
|
|
8
|
+
import { useSeoTranslation } from "../../../../translations/useSeoTranslation";
|
|
9
|
+
const COPY_FEEDBACK_MS = 2e3;
|
|
10
|
+
const COPY_FEEDBACK = {
|
|
11
|
+
idle: { labelKey: "links.copy", Icon: Copy },
|
|
12
|
+
copied: { labelKey: "links.copied", Icon: Check },
|
|
13
|
+
failed: { labelKey: "links.copyFailed", Icon: X }
|
|
14
|
+
};
|
|
15
|
+
function CopyUrlButton({ url }) {
|
|
16
|
+
const { t } = useSeoTranslation();
|
|
17
|
+
const [status, setStatus] = useState("idle");
|
|
18
|
+
const resetRef = useRef(null);
|
|
19
|
+
const { labelKey, Icon } = COPY_FEEDBACK[status];
|
|
20
|
+
const label = t(labelKey);
|
|
21
|
+
useEffect(
|
|
22
|
+
() => () => {
|
|
23
|
+
if (resetRef.current)
|
|
24
|
+
clearTimeout(resetRef.current);
|
|
25
|
+
},
|
|
26
|
+
[]
|
|
27
|
+
);
|
|
28
|
+
const showFeedback = (next) => {
|
|
29
|
+
setStatus(next);
|
|
30
|
+
if (resetRef.current)
|
|
31
|
+
clearTimeout(resetRef.current);
|
|
32
|
+
resetRef.current = setTimeout(() => setStatus("idle"), COPY_FEEDBACK_MS);
|
|
33
|
+
};
|
|
34
|
+
const copy = async () => {
|
|
35
|
+
try {
|
|
36
|
+
await navigator.clipboard.writeText(url);
|
|
37
|
+
showFeedback("copied");
|
|
38
|
+
} catch {
|
|
39
|
+
showFeedback("failed");
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ jsx(
|
|
43
|
+
IconButton,
|
|
44
|
+
{
|
|
45
|
+
"aria-label": label,
|
|
46
|
+
onClick: copy,
|
|
47
|
+
title: label,
|
|
48
|
+
variant: status === "failed" ? "error" : "primary",
|
|
49
|
+
children: /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true" })
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function HighlightedSnippet({
|
|
54
|
+
snippet,
|
|
55
|
+
match
|
|
56
|
+
}) {
|
|
57
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
58
|
+
snippet.slice(0, match.start),
|
|
59
|
+
/* @__PURE__ */ jsx("strong", { children: snippet.slice(match.start, match.end) }),
|
|
60
|
+
snippet.slice(match.end)
|
|
61
|
+
] });
|
|
62
|
+
}
|
|
63
|
+
function LinkSuggestionRow({ suggestion, adminHref }) {
|
|
64
|
+
const { t } = useSeoTranslation();
|
|
65
|
+
return /* @__PURE__ */ jsxs("li", { className: cn("frseo:relative frseo:flex frseo:flex-col frseo:gap-[6px] frseo:px-[15px] frseo:py-[12px]", ROW_SEPARATOR), children: [
|
|
66
|
+
/* @__PURE__ */ jsxs("div", { className: "frseo:flex frseo:items-center frseo:gap-[8px]", children: [
|
|
67
|
+
/* @__PURE__ */ jsx(
|
|
68
|
+
"a",
|
|
69
|
+
{
|
|
70
|
+
className: "frseo:font-semibold frseo:text-[12.5px] frseo:text-neutral-800 frseo:underline",
|
|
71
|
+
href: adminHref,
|
|
72
|
+
rel: "noopener noreferrer",
|
|
73
|
+
target: "_blank",
|
|
74
|
+
children: suggestion.title
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ jsx(Pill, { variant: "neutral", children: t("links.matches", { count: suggestion.count }) })
|
|
78
|
+
] }),
|
|
79
|
+
/* @__PURE__ */ jsxs("div", { className: "frseo:text-[11.5px] frseo:text-neutral-500", children: [
|
|
80
|
+
t("links.matchedPhrase"),
|
|
81
|
+
" ",
|
|
82
|
+
/* @__PURE__ */ jsx("span", { className: "frseo:font-medium frseo:text-neutral-800", children: t("links.quotedPhrase", { phrase: suggestion.phrase }) })
|
|
83
|
+
] }),
|
|
84
|
+
/* @__PURE__ */ jsx("p", { className: "frseo:m-0 frseo:text-[12px] frseo:text-neutral-700", children: /* @__PURE__ */ jsx(HighlightedSnippet, { snippet: suggestion.snippet, match: suggestion.snippetMatch }) }),
|
|
85
|
+
suggestion.url ? /* @__PURE__ */ jsxs("div", { className: "frseo:flex frseo:items-center frseo:gap-[8px]", children: [
|
|
86
|
+
/* @__PURE__ */ jsx("code", { className: "frseo:flex-1 frseo:truncate frseo:font-mono frseo:text-[11px] frseo:text-neutral-600", children: suggestion.url }),
|
|
87
|
+
/* @__PURE__ */ jsx(CopyUrlButton, { url: suggestion.url })
|
|
88
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "frseo:text-[11.5px] frseo:text-neutral-500", children: t("links.noPublicUrl") })
|
|
89
|
+
] });
|
|
90
|
+
}
|
|
91
|
+
export {
|
|
92
|
+
LinkSuggestionRow
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=LinkSuggestionRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/SeoDrawer/tabs/links/LinkSuggestionRow.tsx"],"sourcesContent":["\"use client\";\n\nimport { Check, Copy, X } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { IconButton } from \"../../../../ui/IconButton\";\nimport { Pill } from \"../../../../ui/Pill\";\nimport { cn, ROW_SEPARATOR } from \"../../../../utils/style\";\nimport type { LinkSuggestion, TextRange } from \"../../../../links/types\";\nimport { useSeoTranslation } from \"../../../../translations/useSeoTranslation\";\nimport type { TranslationKey } from \"../../../../translations/types\";\n\ntype CopyStatus = \"idle\" | \"copied\" | \"failed\";\n\nconst COPY_FEEDBACK_MS = 2000;\n\nconst COPY_FEEDBACK = {\n idle: { labelKey: \"links.copy\", Icon: Copy },\n copied: { labelKey: \"links.copied\", Icon: Check },\n failed: { labelKey: \"links.copyFailed\", Icon: X },\n} as const satisfies Record<CopyStatus, { labelKey: TranslationKey; Icon: LucideIcon }>;\n\nfunction CopyUrlButton({ url }: { url: string }) {\n const { t } = useSeoTranslation();\n const [status, setStatus] = useState<CopyStatus>(\"idle\");\n const resetRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const { labelKey, Icon } = COPY_FEEDBACK[status];\n const label = t(labelKey);\n\n useEffect(\n () => () => {\n if (resetRef.current) clearTimeout(resetRef.current);\n },\n []\n );\n\n const showFeedback = (next: CopyStatus) => {\n setStatus(next);\n if (resetRef.current) clearTimeout(resetRef.current);\n resetRef.current = setTimeout(() => setStatus(\"idle\"), COPY_FEEDBACK_MS);\n };\n\n const copy = async () => {\n try {\n await navigator.clipboard.writeText(url);\n showFeedback(\"copied\");\n } catch {\n showFeedback(\"failed\");\n }\n };\n\n return (\n <IconButton\n aria-label={label}\n onClick={copy}\n title={label}\n variant={status === \"failed\" ? \"error\" : \"primary\"}\n >\n <Icon aria-hidden=\"true\" />\n </IconButton>\n );\n}\n\nfunction HighlightedSnippet({\n snippet,\n match,\n}: Pick<LinkSuggestion, \"snippet\"> & { match: TextRange }) {\n return (\n <>\n {snippet.slice(0, match.start)}\n <strong>{snippet.slice(match.start, match.end)}</strong>\n {snippet.slice(match.end)}\n </>\n );\n}\n\ninterface LinkSuggestionRowProps {\n suggestion: LinkSuggestion;\n adminHref: string;\n}\n\nexport function LinkSuggestionRow({ suggestion, adminHref }: LinkSuggestionRowProps) {\n const { t } = useSeoTranslation();\n return (\n <li className={cn(\"relative flex flex-col gap-[6px] px-[15px] py-[12px]\", ROW_SEPARATOR)}>\n <div className=\"flex items-center gap-[8px]\">\n <a\n className=\"font-semibold text-[12.5px] text-neutral-800 underline\"\n href={adminHref}\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n >\n {suggestion.title}\n </a>\n <Pill variant=\"neutral\">{t(\"links.matches\", { count: suggestion.count })}</Pill>\n </div>\n\n <div className=\"text-[11.5px] text-neutral-500\">\n {t(\"links.matchedPhrase\")}{\" \"}\n <span className=\"font-medium text-neutral-800\">\n {t(\"links.quotedPhrase\", { phrase: suggestion.phrase })}\n </span>\n </div>\n\n <p className=\"m-0 text-[12px] text-neutral-700\">\n <HighlightedSnippet snippet={suggestion.snippet} match={suggestion.snippetMatch} />\n </p>\n\n {suggestion.url ? (\n <div className=\"flex items-center gap-[8px]\">\n <code className=\"flex-1 truncate font-mono text-[11px] text-neutral-600\">\n {suggestion.url}\n </code>\n <CopyUrlButton url={suggestion.url} />\n </div>\n ) : (\n <div className=\"text-[11.5px] text-neutral-500\">{t(\"links.noPublicUrl\")}</div>\n )}\n </li>\n );\n}\n"],"mappings":";AA0DM,SAUF,UAVE,KAUF,YAVE;AAxDN,SAAS,OAAO,MAAM,SAAS;AAE/B,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AACrB,SAAS,IAAI,qBAAqB;AAElC,SAAS,yBAAyB;AAKlC,MAAM,mBAAmB;AAEzB,MAAM,gBAAgB;AAAA,EACpB,MAAM,EAAE,UAAU,cAAc,MAAM,KAAK;AAAA,EAC3C,QAAQ,EAAE,UAAU,gBAAgB,MAAM,MAAM;AAAA,EAChD,QAAQ,EAAE,UAAU,oBAAoB,MAAM,EAAE;AAClD;AAEA,SAAS,cAAc,EAAE,IAAI,GAAoB;AAC/C,QAAM,EAAE,EAAE,IAAI,kBAAkB;AAChC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAqB,MAAM;AACvD,QAAM,WAAW,OAA6C,IAAI;AAClE,QAAM,EAAE,UAAU,KAAK,IAAI,cAAc,MAAM;AAC/C,QAAM,QAAQ,EAAE,QAAQ;AAExB;AAAA,IACE,MAAM,MAAM;AACV,UAAI,SAAS;AAAS,qBAAa,SAAS,OAAO;AAAA,IACrD;AAAA,IACA,CAAC;AAAA,EACH;AAEA,QAAM,eAAe,CAAC,SAAqB;AACzC,cAAU,IAAI;AACd,QAAI,SAAS;AAAS,mBAAa,SAAS,OAAO;AACnD,aAAS,UAAU,WAAW,MAAM,UAAU,MAAM,GAAG,gBAAgB;AAAA,EACzE;AAEA,QAAM,OAAO,YAAY;AACvB,QAAI;AACF,YAAM,UAAU,UAAU,UAAU,GAAG;AACvC,mBAAa,QAAQ;AAAA,IACvB,QAAQ;AACN,mBAAa,QAAQ;AAAA,IACvB;AAAA,EACF;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAY;AAAA,MACZ,SAAS;AAAA,MACT,OAAO;AAAA,MACP,SAAS,WAAW,WAAW,UAAU;AAAA,MAEzC,8BAAC,QAAK,eAAY,QAAO;AAAA;AAAA,EAC3B;AAEJ;AAEA,SAAS,mBAAmB;AAAA,EAC1B;AAAA,EACA;AACF,GAA2D;AACzD,SACE,iCACG;AAAA,YAAQ,MAAM,GAAG,MAAM,KAAK;AAAA,IAC7B,oBAAC,YAAQ,kBAAQ,MAAM,MAAM,OAAO,MAAM,GAAG,GAAE;AAAA,IAC9C,QAAQ,MAAM,MAAM,GAAG;AAAA,KAC1B;AAEJ;AAOO,SAAS,kBAAkB,EAAE,YAAY,UAAU,GAA2B;AACnF,QAAM,EAAE,EAAE,IAAI,kBAAkB;AAChC,SACE,qBAAC,QAAG,WAAW,GAAG,wDAAwD,aAAa,GACrF;AAAA,yBAAC,SAAI,WAAU,+BACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,MAAM;AAAA,UACN,KAAI;AAAA,UACJ,QAAO;AAAA,UAEN,qBAAW;AAAA;AAAA,MACd;AAAA,MACA,oBAAC,QAAK,SAAQ,WAAW,YAAE,iBAAiB,EAAE,OAAO,WAAW,MAAM,CAAC,GAAE;AAAA,OAC3E;AAAA,IAEA,qBAAC,SAAI,WAAU,kCACZ;AAAA,QAAE,qBAAqB;AAAA,MAAG;AAAA,MAC3B,oBAAC,UAAK,WAAU,gCACb,YAAE,sBAAsB,EAAE,QAAQ,WAAW,OAAO,CAAC,GACxD;AAAA,OACF;AAAA,IAEA,oBAAC,OAAE,WAAU,oCACX,8BAAC,sBAAmB,SAAS,WAAW,SAAS,OAAO,WAAW,cAAc,GACnF;AAAA,IAEC,WAAW,MACV,qBAAC,SAAI,WAAU,+BACb;AAAA,0BAAC,UAAK,WAAU,0DACb,qBAAW,KACd;AAAA,MACA,oBAAC,iBAAc,KAAK,WAAW,KAAK;AAAA,OACtC,IAEA,oBAAC,SAAI,WAAU,kCAAkC,YAAE,mBAAmB,GAAE;AAAA,KAE5E;AAEJ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFlushOnHide.d.ts","sourceRoot":"","sources":["../../../src/components/SeoDrawer/useFlushOnHide.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAkB9D"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
function useFlushOnHide(saver) {
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
if (!saver)
|
|
6
|
+
return;
|
|
7
|
+
const flush = () => void saver.flush();
|
|
8
|
+
const flushWhenHidden = () => {
|
|
9
|
+
if (document.visibilityState === "hidden")
|
|
10
|
+
flush();
|
|
11
|
+
};
|
|
12
|
+
window.addEventListener("pagehide", flush);
|
|
13
|
+
document.addEventListener("visibilitychange", flushWhenHidden);
|
|
14
|
+
return () => {
|
|
15
|
+
window.removeEventListener("pagehide", flush);
|
|
16
|
+
document.removeEventListener("visibilitychange", flushWhenHidden);
|
|
17
|
+
flush();
|
|
18
|
+
};
|
|
19
|
+
}, [saver]);
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
useFlushOnHide
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=useFlushOnHide.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/SeoDrawer/useFlushOnHide.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport type { RemoteSaver } from \"./remoteSaver\";\n\nexport function useFlushOnHide(saver: RemoteSaver | null): void {\n useEffect(() => {\n if (!saver) return;\n\n const flush = () => void saver.flush();\n const flushWhenHidden = () => {\n if (document.visibilityState === \"hidden\") flush();\n };\n\n window.addEventListener(\"pagehide\", flush);\n document.addEventListener(\"visibilitychange\", flushWhenHidden);\n\n return () => {\n window.removeEventListener(\"pagehide\", flush);\n document.removeEventListener(\"visibilitychange\", flushWhenHidden);\n flush();\n };\n }, [saver]);\n}\n"],"mappings":";AAEA,SAAS,iBAAiB;AAGnB,SAAS,eAAe,OAAiC;AAC9D,YAAU,MAAM;AACd,QAAI,CAAC;AAAO;AAEZ,UAAM,QAAQ,MAAM,KAAK,MAAM,MAAM;AACrC,UAAM,kBAAkB,MAAM;AAC5B,UAAI,SAAS,oBAAoB;AAAU,cAAM;AAAA,IACnD;AAEA,WAAO,iBAAiB,YAAY,KAAK;AACzC,aAAS,iBAAiB,oBAAoB,eAAe;AAE7D,WAAO,MAAM;AACX,aAAO,oBAAoB,YAAY,KAAK;AAC5C,eAAS,oBAAoB,oBAAoB,eAAe;AAChE,YAAM;AAAA,IACR;AAAA,EACF,GAAG,CAAC,KAAK,CAAC;AACZ;","names":[]}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
import type { StoredKeyphrase } from "../../keyphrases/stored";
|
|
1
2
|
import type { KeyphraseEntry } from "./keyphraseState";
|
|
3
|
+
export interface RemoteKeyphrases {
|
|
4
|
+
apiRoute: string;
|
|
5
|
+
initial: StoredKeyphrase[];
|
|
6
|
+
indexed: boolean;
|
|
7
|
+
canUpdate: boolean;
|
|
8
|
+
}
|
|
2
9
|
export interface UseKeyphrasesArgs {
|
|
3
10
|
collectionSlug: string;
|
|
4
11
|
docId: string;
|
|
5
12
|
localeCode: string;
|
|
13
|
+
remote?: RemoteKeyphrases;
|
|
6
14
|
}
|
|
7
15
|
export interface UseKeyphrasesApi {
|
|
8
16
|
keyphrases: KeyphraseEntry[];
|
|
@@ -13,6 +21,9 @@ export interface UseKeyphrasesApi {
|
|
|
13
21
|
remove: (id: string) => void;
|
|
14
22
|
setFocus: (id: string) => void;
|
|
15
23
|
isDuplicate: (id: string, text: string) => boolean;
|
|
24
|
+
syncOnOpen: () => void;
|
|
25
|
+
readOnly: boolean;
|
|
26
|
+
saveFailed: boolean;
|
|
16
27
|
}
|
|
17
|
-
export declare function useKeyphrases({ collectionSlug, docId, localeCode, }: UseKeyphrasesArgs): UseKeyphrasesApi;
|
|
28
|
+
export declare function useKeyphrases({ collectionSlug, docId, localeCode, remote, }: UseKeyphrasesArgs): UseKeyphrasesApi;
|
|
18
29
|
//# sourceMappingURL=useKeyphrases.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyphrases.d.ts","sourceRoot":"","sources":["../../../src/components/SeoDrawer/useKeyphrases.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useKeyphrases.d.ts","sourceRoot":"","sources":["../../../src/components/SeoDrawer/useKeyphrases.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAcvD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,UAAU,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACrC,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACnD,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;CACrB;AAqBD,wBAAgB,aAAa,CAAC,EAC5B,cAAc,EACd,KAAK,EACL,UAAU,EACV,MAAM,GACP,EAAE,iBAAiB,GAAG,gBAAgB,CAkHtC"}
|
|
@@ -1,14 +1,49 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import * as ops from "./keyphraseState";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
entriesOrBlank,
|
|
6
|
+
loadKeyphrases,
|
|
7
|
+
loadUnsavedKeyphrases,
|
|
8
|
+
saveKeyphrases,
|
|
9
|
+
storageKey,
|
|
10
|
+
unsavedStorageKey
|
|
11
|
+
} from "./keyphraseStorage";
|
|
12
|
+
import { createRemoteSaver } from "./remoteSaver";
|
|
13
|
+
import { useFlushOnHide } from "./useFlushOnHide";
|
|
14
|
+
import { useRemoteSync } from "./useRemoteSync";
|
|
15
|
+
function initialList(key, remote) {
|
|
16
|
+
return remote?.indexed ? entriesOrBlank(remote.initial) : loadKeyphrases(key);
|
|
17
|
+
}
|
|
18
|
+
function initialState(key, unsavedKey, remote) {
|
|
19
|
+
const unsaved = remote?.canUpdate ? loadUnsavedKeyphrases(unsavedKey) : null;
|
|
20
|
+
if (unsaved)
|
|
21
|
+
return { entries: unsaved, sync: "retry" };
|
|
22
|
+
const entries = initialList(key, remote);
|
|
23
|
+
const hasBrowserCopy = remote?.canUpdate && !remote.indexed && ops.pruneEmpties(entries).length;
|
|
24
|
+
return { entries, sync: hasBrowserCopy ? "upload" : null };
|
|
25
|
+
}
|
|
5
26
|
function useKeyphrases({
|
|
6
27
|
collectionSlug,
|
|
7
28
|
docId,
|
|
8
|
-
localeCode
|
|
29
|
+
localeCode,
|
|
30
|
+
remote
|
|
9
31
|
}) {
|
|
10
32
|
const key = storageKey(collectionSlug, docId, localeCode);
|
|
11
|
-
const [
|
|
33
|
+
const [initial] = useState(
|
|
34
|
+
() => initialState(key, unsavedStorageKey(collectionSlug, docId, localeCode), remote)
|
|
35
|
+
);
|
|
36
|
+
const [list, setList] = useState(initial.entries);
|
|
37
|
+
const [saveFailed, setSaveFailed] = useState(false);
|
|
38
|
+
const persistLocally = !remote;
|
|
39
|
+
const apiRoute = remote?.canUpdate ? remote.apiRoute : void 0;
|
|
40
|
+
const saver = useMemo(
|
|
41
|
+
() => apiRoute ? createRemoteSaver(
|
|
42
|
+
{ apiRoute, collection: collectionSlug, docId, locale: localeCode },
|
|
43
|
+
{ onOutcome: (outcome) => setSaveFailed(outcome.status === "failed") }
|
|
44
|
+
) : null,
|
|
45
|
+
[apiRoute, collectionSlug, docId, localeCode]
|
|
46
|
+
);
|
|
12
47
|
const keyRef = useRef(key);
|
|
13
48
|
useEffect(() => {
|
|
14
49
|
if (keyRef.current !== key) {
|
|
@@ -17,40 +52,65 @@ function useKeyphrases({
|
|
|
17
52
|
}
|
|
18
53
|
}, [key]);
|
|
19
54
|
useEffect(() => {
|
|
20
|
-
|
|
21
|
-
|
|
55
|
+
if (persistLocally)
|
|
56
|
+
saveKeyphrases(key, list);
|
|
57
|
+
}, [key, list, persistLocally]);
|
|
58
|
+
useFlushOnHide(saver);
|
|
22
59
|
const listRef = useRef(list);
|
|
23
60
|
listRef.current = list;
|
|
24
61
|
useEffect(
|
|
25
62
|
() => () => {
|
|
63
|
+
if (!persistLocally)
|
|
64
|
+
return;
|
|
26
65
|
const pruned = ops.pruneEmpties(listRef.current);
|
|
27
66
|
if (pruned.length !== listRef.current.length)
|
|
28
67
|
saveKeyphrases(keyRef.current, pruned);
|
|
29
68
|
},
|
|
30
|
-
[]
|
|
69
|
+
[persistLocally]
|
|
31
70
|
);
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
const next = ops.addRelated(current);
|
|
35
|
-
if (next === current)
|
|
36
|
-
return void 0;
|
|
71
|
+
const replaceList = useCallback((next) => {
|
|
72
|
+
listRef.current = next;
|
|
37
73
|
setList(next);
|
|
38
|
-
return next.at(-1)?.id;
|
|
39
74
|
}, []);
|
|
75
|
+
const { syncOnOpen, cancelSync } = useRemoteSync({
|
|
76
|
+
saver,
|
|
77
|
+
pending: initial.sync,
|
|
78
|
+
browserKey: key,
|
|
79
|
+
listRef,
|
|
80
|
+
replaceList
|
|
81
|
+
});
|
|
82
|
+
const apply = useCallback(
|
|
83
|
+
(op) => {
|
|
84
|
+
const current = listRef.current;
|
|
85
|
+
const next = op(current);
|
|
86
|
+
if (next === current)
|
|
87
|
+
return current;
|
|
88
|
+
replaceList(next);
|
|
89
|
+
saver?.schedule(next);
|
|
90
|
+
cancelSync();
|
|
91
|
+
return next;
|
|
92
|
+
},
|
|
93
|
+
[cancelSync, replaceList, saver]
|
|
94
|
+
);
|
|
95
|
+
const addRelated = useCallback(() => {
|
|
96
|
+
const current = listRef.current;
|
|
97
|
+
const next = apply(ops.addRelated);
|
|
98
|
+
return next === current ? void 0 : next.at(-1)?.id;
|
|
99
|
+
}, [apply]);
|
|
40
100
|
const updateText = useCallback(
|
|
41
|
-
(id, text) =>
|
|
42
|
-
[]
|
|
101
|
+
(id, text) => apply((l) => ops.updateText(l, id, text)),
|
|
102
|
+
[apply]
|
|
43
103
|
);
|
|
44
104
|
const addSynonym = useCallback(
|
|
45
|
-
(id, syn) =>
|
|
46
|
-
[]
|
|
105
|
+
(id, syn) => apply((l) => ops.addSynonym(l, id, syn)),
|
|
106
|
+
[apply]
|
|
47
107
|
);
|
|
48
108
|
const removeSynonym = useCallback(
|
|
49
|
-
(id, index) =>
|
|
50
|
-
[]
|
|
109
|
+
(id, index) => apply((l) => ops.removeSynonym(l, id, index)),
|
|
110
|
+
[apply]
|
|
51
111
|
);
|
|
52
|
-
const remove = useCallback((id) =>
|
|
53
|
-
const setFocus = useCallback((id) =>
|
|
112
|
+
const remove = useCallback((id) => apply((l) => ops.remove(l, id)), [apply]);
|
|
113
|
+
const setFocus = useCallback((id) => apply((l) => ops.setFocus(l, id)), [apply]);
|
|
54
114
|
const isDuplicate = useCallback(
|
|
55
115
|
(id, text) => ops.isDuplicate(listRef.current, id, text),
|
|
56
116
|
[]
|
|
@@ -63,7 +123,10 @@ function useKeyphrases({
|
|
|
63
123
|
removeSynonym,
|
|
64
124
|
remove,
|
|
65
125
|
setFocus,
|
|
66
|
-
isDuplicate
|
|
126
|
+
isDuplicate,
|
|
127
|
+
syncOnOpen,
|
|
128
|
+
readOnly: Boolean(remote && !remote.canUpdate),
|
|
129
|
+
saveFailed
|
|
67
130
|
};
|
|
68
131
|
}
|
|
69
132
|
export {
|