@morphemecms/cms 0.11.0 → 0.13.0-next-20261106203613
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/CHANGELOG.md +31 -0
- package/astro.mjs +2 -1
- package/defaults/blockTexts.ts +9 -9
- package/defaults/collections.ts +257 -257
- package/defaults/colors.ts +74 -74
- package/defaults/company.ts +9 -9
- package/defaults/editor.ts +65 -65
- package/defaults/i18n/da-DK/blockTexts.ts +12 -0
- package/defaults/i18n/da-DK/collections.ts +220 -0
- package/defaults/i18n/da-DK/colors.ts +102 -0
- package/defaults/i18n/da-DK/company.ts +7 -0
- package/defaults/i18n/da-DK/editor.ts +13 -0
- package/defaults/i18n/da-DK/index.ts +31 -0
- package/defaults/i18n/da-DK/internalLinks.ts +12 -0
- package/defaults/i18n/da-DK/opens.ts +7 -0
- package/defaults/i18n/da-DK/popup.ts +9 -0
- package/defaults/i18n/da-DK/privacy.ts +38 -0
- package/defaults/i18n/da-DK/rules.ts +56 -0
- package/defaults/i18n/da-DK/sitedata.ts +8 -0
- package/defaults/i18n/da-DK/standard.ts +8 -0
- package/defaults/i18n/da-DK/standardPages.ts +17 -0
- package/defaults/internalLinks.ts +8 -8
- package/defaults/opens.ts +2 -2
- package/defaults/popup.tsx +7 -7
- package/defaults/privacy.ts +37 -37
- package/defaults/rules.ts +68 -66
- package/defaults/schema.ts +1 -1
- package/defaults/sitedata.ts +4 -4
- package/defaults/standard.ts +9 -6
- package/defaults/standardPages.ts +14 -14
- package/defaults/texts.ts +7 -510
- package/lib/appId.d.mts +1 -0
- package/lib/appId.mjs +6 -0
- package/lib/appRoute.d.mts +2 -2
- package/lib/appRoute.mjs +3 -3
- package/lib/appRoute.test.mjs +8 -8
- package/lib/apps.mjs +13 -3
- package/lib/apps.test.mjs +10 -1
- package/lib/contracts.d.mts +3 -2
- package/lib/contracts.mjs +3 -2
- package/lib/folderChanges.d.mts +29 -0
- package/lib/folderChanges.mjs +34 -0
- package/lib/licenses.mjs +2 -2
- package/lib/licenses.owner.test.mjs +9 -0
- package/lib/menu.mjs +4 -4
- package/lib/menu.test.mjs +101 -101
- package/lib/scheduled.mjs +1 -1
- package/lib/section-ranges.d.mts +1 -1
- package/lib/section-ranges.mjs +8 -14
- package/lib/section-ranges.test.mjs +26 -5
- package/lib/storeEntries.d.mts +3 -1
- package/lib/storeEntries.mjs +22 -8
- package/lib/storeEntries.test.mjs +59 -7
- package/lib/text-sections.d.mts +11 -1
- package/lib/text-sections.mjs +18 -8
- package/lib/text-sections.test.mjs +34 -1
- package/lib/translate.d.mts +11 -0
- package/lib/translate.mjs +13 -1
- package/lib/translate.test.mjs +23 -2
- package/lib/video-id.d.mts +6 -2
- package/lib/video-id.mjs +5 -1
- package/lib/video.d.mts +6 -2
- package/lib/video.mjs +5 -1
- package/lib/without-h1.d.mts +1 -0
- package/lib/without-h1.mjs +19 -4
- package/lib/without-h1.test.mjs +30 -1
- package/package.json +3 -2
- package/scripts/app-screenshots.mjs +9 -8
- package/scripts/check-content.mjs +12 -2
- package/scripts/check-language.mjs +0 -1
- package/scripts/check-site-types.mjs +26 -0
- package/scripts/editor-screens.mjs +3 -3
- package/scripts/site-types.mjs +14 -0
- package/scripts/site-types.test.mjs +21 -0
- package/site/activeTheme.test.mjs +52 -0
- package/site/appSelf.d.mts +2 -0
- package/site/appSelf.mjs +23 -0
- package/site/appSelf.test.mjs +35 -0
- package/site/content.ts +5 -2
- package/site/defineSite.mjs +2 -2
- package/site/schema.ts +3 -3
- package/site/siteModules.mjs +2 -1
- package/site/theme.mjs +19 -8
- package/src/Advanced.tsx +2 -2
- package/src/App.tsx +79 -78
- package/src/AppAdds.tsx +1 -1
- package/src/AppList.tsx +39 -24
- package/src/BlockDialog.tsx +39 -18
- package/src/BlockParts.tsx +6 -6
- package/src/BlockSettings.tsx +2 -2
- package/src/BrandForm.tsx +2 -2
- package/src/Colors.tsx +6 -6
- package/src/CompanyForm.tsx +1 -1
- package/src/Consents.tsx +3 -3
- package/src/CreateFab.tsx +8 -0
- package/src/DataForm.tsx +10 -20
- package/src/Deleted.tsx +3 -3
- package/src/EditorFooter.tsx +2 -2
- package/src/EntryForm.tsx +3 -3
- package/src/FooterSettings.tsx +2 -2
- package/src/FormFrame.tsx +4 -3
- package/src/HeaderSettings.tsx +3 -3
- package/src/Keywords.tsx +5 -5
- package/src/Library.tsx +75 -82
- package/src/Licenses.tsx +8 -8
- package/src/ListFab.tsx +13 -0
- package/src/MainDrawerParts.tsx +3 -3
- package/src/MainMenu.tsx +1 -1
- package/src/MarkdownEditor.tsx +88 -47
- package/src/Media.tsx +11 -20
- package/src/MediaTags.tsx +2 -2
- package/src/Notifications.tsx +2 -2
- package/src/Parts.tsx +17 -17
- package/src/Redirects.tsx +14 -22
- package/src/Screen.tsx +16 -6
- package/src/SeoScores.tsx +6 -6
- package/src/SideColumn.tsx +2 -2
- package/src/StartFab.tsx +6 -8
- package/src/ThemeStore.tsx +37 -16
- package/src/Tokens.tsx +2 -2
- package/src/apps.ts +7 -8
- package/src/checkSite.ts +86 -20
- package/src/drawerYield.d.mts +3 -0
- package/src/drawerYield.mjs +10 -0
- package/src/drawerYield.test.mjs +22 -0
- package/src/editor.css +59 -38
- package/src/examples.ts +1 -1
- package/src/fabScreens.test.mjs +28 -0
- package/src/fabScreens.ts +16 -0
- package/src/i18n/da-DK/library.ts +2 -2
- package/src/i18n/da-DK/text.ts +1 -1
- package/src/i18n/en-US/apps.ts +1 -1
- package/src/i18n/en-US/common.ts +8 -8
- package/src/i18n/en-US/library.ts +5 -5
- package/src/i18n/en-US/parts.ts +3 -3
- package/src/i18n/en-US/text.ts +1 -1
- package/src/i18n/index.ts +4 -8
- package/src/images.ts +2 -2
- package/src/legacyMove.test.mjs +137 -0
- package/src/legacyMove.ts +131 -0
- package/src/licenseData.ts +3 -3
- package/src/markdown.mjs +10 -7
- package/src/markdown.test.mjs +16 -2
- package/src/menuChildren.ts +5 -5
- package/src/menuOpen.ts +20 -4
- package/src/movedRoutes.d.mts +8 -1
- package/src/movedRoutes.mjs +102 -21
- package/src/movedRoutes.test.mjs +128 -6
- package/src/nav.ts +1 -1
- package/src/notificationData.ts +1 -1
- package/src/pageH1Panel.d.mts +4 -0
- package/src/pageH1Panel.mjs +31 -0
- package/src/pageH1Panel.test.mjs +56 -0
- package/src/pagePreview.tsx +22 -12
- package/src/schema.ts +2 -2
- package/src/sectionFrame.ts +3 -3
- package/src/sectionState.d.mts +3 -3
- package/src/sectionState.mjs +6 -6
- package/src/sectionState.test.mjs +14 -2
- package/src/sheetPlacement.d.mts +6 -4
- package/src/sheetPlacement.mjs +15 -10
- package/src/sheetPlacement.test.mjs +16 -9
- package/src/sidePanel.ts +38 -0
- package/src/site.ts +37 -13
- package/src/standard/accordion/index.tsx +1 -1
- package/src/standard/accordion/shared.ts +1 -1
- package/src/standard/buttons/index.tsx +1 -1
- package/src/standard/cards/index.tsx +1 -1
- package/src/standard/cards/shared.ts +1 -1
- package/src/standard/cookies/index.tsx +1 -1
- package/src/standard/posts/index.tsx +1 -1
- package/src/standard/testimonials/index.tsx +1 -1
- package/src/standard/testimonials/list.ts +1 -1
- package/src/store.ts +36 -31
- package/src/tagUses.d.mts +1 -1
- package/src/tagUses.mjs +2 -2
- package/src/tagUses.test.mjs +1 -1
- package/src/topBarSlot.tsx +7 -15
- package/src/ui.tsx +33 -22
- package/src/virtual.d.ts +6 -0
- package/starter/package.json +1 -1
- package/theme/components/PageHeading.astro +22 -0
- package/theme/layouts/Base.astro +2 -2
- package/theme/layouts/PageLayout.astro +37 -20
- package/theme/styles/global.css +2 -1
- package/theme/styles/ui.css +40 -10
package/lib/appRoute.test.mjs
CHANGED
|
@@ -7,23 +7,23 @@ test('apps/cms-version', () => {
|
|
|
7
7
|
deepEqual(appRouteOf('apps/cms-version', 'cms-version'), { tab: 'settings' });
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
test('apps/cms-version/
|
|
11
|
-
deepEqual(appRouteOf('apps/cms-version/
|
|
10
|
+
test('apps/cms-version/about', () => {
|
|
11
|
+
deepEqual(appRouteOf('apps/cms-version/about', 'cms-version'), { tab: 'information' });
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
test('apps/cms-version/
|
|
15
|
-
deepEqual(appRouteOf('apps/cms-version/
|
|
14
|
+
test('apps/cms-version/settings', () => {
|
|
15
|
+
deepEqual(appRouteOf('apps/cms-version/settings', 'cms-version'), { tab: 'settings' });
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
test('apps/cms-version/
|
|
19
|
-
deepEqual(appRouteOf('apps/cms-version/
|
|
18
|
+
test('apps/cms-version/settings/variant', () => {
|
|
19
|
+
deepEqual(appRouteOf('apps/cms-version/settings/variant', 'cms-version'), {
|
|
20
20
|
tab: 'settings',
|
|
21
21
|
page: 'variant',
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
test('apps/cms-version/
|
|
26
|
-
deepEqual(appRouteOf('apps/cms-version/
|
|
25
|
+
test('apps/cms-version/settings/a/b', () => {
|
|
26
|
+
deepEqual(appRouteOf('apps/cms-version/settings/a/b', 'cms-version'), null);
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
test('apps/cms-version/other', () => {
|
package/lib/apps.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// A site folder in src/apps/ named app_ or theme_ that is not a store id stops the build (appIds, strayStoreId).
|
|
1
2
|
// What an app (src/apps/<app>/, packages/editor/src/apps.ts) can have outside the editor and the pages, each only while
|
|
2
3
|
// it is installed (src/data/apps.json):
|
|
3
4
|
// worker.js its part of the site's Worker: its own addresses, /api/<app>/… (`fetch`), and what it does each hour
|
|
@@ -11,6 +12,7 @@
|
|
|
11
12
|
import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
|
|
12
13
|
import { join, sep } from 'node:path';
|
|
13
14
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
15
|
+
import { strayStoreId } from './storeEntries.mjs';
|
|
14
16
|
|
|
15
17
|
/** Where an app's files from the build are, in the build (dist/) and so on the site (served only to the Worker). */
|
|
16
18
|
export const APP_FILES = '_apps';
|
|
@@ -19,14 +21,22 @@ const APPS = 'src/apps';
|
|
|
19
21
|
const INSTALLED = 'src/data/apps.json';
|
|
20
22
|
const WORKERS = 'worker/apps.js';
|
|
21
23
|
|
|
22
|
-
/** The ids of the apps, all of them (the folders in src/apps/).
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
/** The ids of the apps, all of them (the folders in src/apps/). Stops on a folder that starts with `app_` or `theme_` but
|
|
25
|
+
* is not a store id of an app. @param {string} root */
|
|
26
|
+
export const appIds = (root) => {
|
|
27
|
+
const ids = existsSync(join(root, APPS))
|
|
25
28
|
? readdirSync(join(root, APPS), { withFileTypes: true })
|
|
26
29
|
.filter((d) => d.isDirectory())
|
|
27
30
|
.map((d) => d.name)
|
|
28
31
|
.sort()
|
|
29
32
|
: [];
|
|
33
|
+
const stray = ids.find((id) => strayStoreId(id, 'app'));
|
|
34
|
+
if (stray)
|
|
35
|
+
throw new Error(
|
|
36
|
+
`${APPS}/${stray}: the folder name looks like a store id but is not one. A store app id is app_ and 16 lowercase hex characters; rename the folder.`,
|
|
37
|
+
);
|
|
38
|
+
return ids;
|
|
39
|
+
};
|
|
30
40
|
|
|
31
41
|
/** The ids of the apps installed. @param {string} root @returns {string[]} */
|
|
32
42
|
export function installedApps(root) {
|
package/lib/apps.test.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { strict as assert } from 'node:assert/strict';
|
|
|
5
5
|
import { mkdtempSync, rmSync, writeFileSync, mkdirSync, readFileSync } from 'node:fs';
|
|
6
6
|
import { tmpdir } from 'node:os';
|
|
7
7
|
import { join } from 'node:path';
|
|
8
|
-
import { appWorkersFile, appWorkersProblems, writeAppWorkers } from './apps.mjs';
|
|
8
|
+
import { appIds, appWorkersFile, appWorkersProblems, writeAppWorkers } from './apps.mjs';
|
|
9
9
|
|
|
10
10
|
describe('lib/apps.mjs', () => {
|
|
11
11
|
let root;
|
|
@@ -47,4 +47,13 @@ describe('lib/apps.mjs', () => {
|
|
|
47
47
|
assert.equal(writeAppWorkers(root), true);
|
|
48
48
|
assert.equal(readFileSync(file, 'utf8'), appWorkersFile(root));
|
|
49
49
|
});
|
|
50
|
+
|
|
51
|
+
it('appIds lists permanent ids and own names, and stops on a folder that is not a store id', () => {
|
|
52
|
+
mkdirSync(join(root, 'src/apps/app_a030dfba69793996'), { recursive: true });
|
|
53
|
+
assert.deepEqual(appIds(root), ['app_a030dfba69793996', 'booking']);
|
|
54
|
+
mkdirSync(join(root, 'src/apps/app_xyz'), { recursive: true });
|
|
55
|
+
assert.throws(() => appIds(root), /src\/apps\/app_xyz/);
|
|
56
|
+
rmSync(join(root, 'src/apps/app_xyz'), { recursive: true });
|
|
57
|
+
rmSync(join(root, 'src/apps/app_a030dfba69793996'), { recursive: true });
|
|
58
|
+
});
|
|
50
59
|
});
|
package/lib/contracts.d.mts
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
/** The version of the contract between the editor and an app (apps.ts: defineApp, its folder, and the theme's parts it
|
|
6
6
|
* draws with: the standard blocks' and the UI components, @theme/blocks/… and @theme/ui/…, imported from
|
|
7
7
|
* @morphemecms/cms): an app in the store says which it is written to, and only those the editor can run are
|
|
8
|
-
* offered. Raised when an app written to the one before no longer works.
|
|
9
|
-
|
|
8
|
+
* offered. Raised when an app written to the one before no longer works. 3 adds `import self from '@app/self'` (the id
|
|
9
|
+
* of the app's own folder, site/appSelf.mjs); an app written to 2 works as before. */
|
|
10
|
+
export const APP_API: 3;
|
|
10
11
|
/** The version of the contract between the editor and a theme (what a theme must and may have, "Hvad et tema må" in
|
|
11
12
|
* CLAUDE.md, themeProblems in packages/editor/site/theme.mjs, the standard theme's UI parts with Material 3's names and
|
|
12
13
|
* variants, the motion scheme's --motion-* springs and motionSpring/motionTiming (@morphemecms/cms/lib/motion),
|
package/lib/contracts.mjs
CHANGED
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
/** The version of the contract between the editor and an app (apps.ts: defineApp, its folder, and the theme's parts it
|
|
7
7
|
* draws with: the standard blocks' and the UI components, @theme/blocks/… and @theme/ui/…, imported from
|
|
8
8
|
* @morphemecms/cms): an app in the store says which it is written to, and only those the editor can run are
|
|
9
|
-
* offered. Raised when an app written to the one before no longer works.
|
|
10
|
-
|
|
9
|
+
* offered. Raised when an app written to the one before no longer works. 3 adds `import self from '@app/self'` (the id
|
|
10
|
+
* of the app's own folder, site/appSelf.mjs); an app written to 2 works as before. */
|
|
11
|
+
export const APP_API = 3;
|
|
11
12
|
|
|
12
13
|
/** The version of the contract between the editor and a theme (what a theme must and may have, "Hvad et tema må" in
|
|
13
14
|
* CLAUDE.md, themeProblems in packages/editor/site/theme.mjs, the standard theme's UI parts with Material 3's names and
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** @typedef {{ path: string, oid: string }} RepoFile
|
|
2
|
+
* @typedef {{ path: string, content: string | Uint8Array | null, oid: string | null }} Change */
|
|
3
|
+
/** The changes that make a folder in the site (`current`, its files now) the store's version of an app or a theme, with
|
|
4
|
+
* the note of where it came from, or remove it (`next` null).
|
|
5
|
+
* @param {string} folder
|
|
6
|
+
* @param {RepoFile[]} current
|
|
7
|
+
* @param {{ files: { path: string, content: string | Uint8Array }[], record: { files: { path: string, oid: string }[] } } | null} next
|
|
8
|
+
* @returns {Change[]} */
|
|
9
|
+
export function folderChanges(folder: string, current: RepoFile[], next: {
|
|
10
|
+
files: {
|
|
11
|
+
path: string;
|
|
12
|
+
content: string | Uint8Array;
|
|
13
|
+
}[];
|
|
14
|
+
record: {
|
|
15
|
+
files: {
|
|
16
|
+
path: string;
|
|
17
|
+
oid: string;
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
20
|
+
} | null): Change[];
|
|
21
|
+
export type RepoFile = {
|
|
22
|
+
path: string;
|
|
23
|
+
oid: string;
|
|
24
|
+
};
|
|
25
|
+
export type Change = {
|
|
26
|
+
path: string;
|
|
27
|
+
content: string | Uint8Array | null;
|
|
28
|
+
oid: string | null;
|
|
29
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// The changes that make a folder in a site the store's version of an app or a theme, with its store.json note, or remove
|
|
2
|
+
// it. Exposes folderChanges (used by src/store.ts and src/legacyMove.ts). Depends on ./storeEntries.mjs (RECORD).
|
|
3
|
+
import { RECORD } from './storeEntries.mjs';
|
|
4
|
+
|
|
5
|
+
/** @typedef {{ path: string, oid: string }} RepoFile
|
|
6
|
+
* @typedef {{ path: string, content: string | Uint8Array | null, oid: string | null }} Change */
|
|
7
|
+
|
|
8
|
+
/** The changes that make a folder in the site (`current`, its files now) the store's version of an app or a theme, with
|
|
9
|
+
* the note of where it came from, or remove it (`next` null).
|
|
10
|
+
* @param {string} folder
|
|
11
|
+
* @param {RepoFile[]} current
|
|
12
|
+
* @param {{ files: { path: string, content: string | Uint8Array }[], record: { files: { path: string, oid: string }[] } } | null} next
|
|
13
|
+
* @returns {Change[]} */
|
|
14
|
+
export function folderChanges(folder, current, next) {
|
|
15
|
+
const now = new Map(current.map((f) => [f.path, f.oid]));
|
|
16
|
+
/** @type {{ path: string, content: string | Uint8Array, oid?: string }[]} */
|
|
17
|
+
const wanted = next
|
|
18
|
+
? [
|
|
19
|
+
...next.files.map((f) => ({
|
|
20
|
+
path: `${folder}/${f.path}`,
|
|
21
|
+
content: f.content,
|
|
22
|
+
oid: next.record.files.find((r) => r.path === f.path)?.oid,
|
|
23
|
+
})),
|
|
24
|
+
{ path: `${folder}/${RECORD}`, content: `${JSON.stringify(next.record, null, 2)}\n` },
|
|
25
|
+
]
|
|
26
|
+
: [];
|
|
27
|
+
return [
|
|
28
|
+
// A file the site has as it is in the store is left as it is.
|
|
29
|
+
...wanted
|
|
30
|
+
.filter((w) => !w.oid || now.get(w.path) !== w.oid)
|
|
31
|
+
.map((w) => ({ path: w.path, content: w.content, oid: now.get(w.path) ?? null })),
|
|
32
|
+
...current.filter((f) => !wanted.some((w) => w.path === f.path)).map((f) => ({ path: f.path, content: null, oid: f.oid })),
|
|
33
|
+
];
|
|
34
|
+
}
|
package/lib/licenses.mjs
CHANGED
|
@@ -237,8 +237,8 @@ export function importsIn(folder) {
|
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
/** An app's or a theme's id among the licences ("Licenser": its group, its own licence's page), and where it brings
|
|
240
|
-
* something (a shipped package's `where`): `app/<id>`, `
|
|
241
|
-
export const ownerId = (kind, id) => `${kind === 'app' ? 'app' : '
|
|
240
|
+
* something (a shipped package's `where`): `app/<id>`, `theme/<id>`. */
|
|
241
|
+
export const ownerId = (kind, id) => `${kind === 'app' ? 'app' : 'theme'}/${id}`;
|
|
242
242
|
|
|
243
243
|
/** A text's id in an address (`Pictogrammers Free License` → `pictogrammers-free-license`). */
|
|
244
244
|
const slug = (text) =>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Tests ownerId in licenses.mjs: an app's and a theme's id among the licences, with their English kinds.
|
|
2
|
+
import { test } from 'node:test';
|
|
3
|
+
import assert from 'node:assert/strict';
|
|
4
|
+
import { ownerId } from './licenses.mjs';
|
|
5
|
+
|
|
6
|
+
test('an owner id starts with the English kind', () => {
|
|
7
|
+
assert.equal(ownerId('app', 'calendly'), 'app/calendly');
|
|
8
|
+
assert.equal(ownerId('theme', 'saturn'), 'theme/saturn');
|
|
9
|
+
});
|
package/lib/menu.mjs
CHANGED
|
@@ -33,7 +33,7 @@ export function menuTree(groups, partOf, childrenOf) {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
const PARENTS = ['
|
|
36
|
+
const PARENTS = ['company', 'blocks', 'appearance', 'seo', 'apps'];
|
|
37
37
|
|
|
38
38
|
const under = (path, prefix) => path === prefix || path.startsWith(prefix + '/');
|
|
39
39
|
|
|
@@ -47,15 +47,15 @@ export function currentPart(route, known) {
|
|
|
47
47
|
return 'appstore';
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
const part = known.open || route.replace(/^(
|
|
50
|
+
const part = known.open || route.replace(/^(list|new|deleted)\/([^/]+).*/, '$2');
|
|
51
51
|
|
|
52
52
|
if (part === known.cookies) {
|
|
53
53
|
// The cookie list is a list, but its place is under Privacy.
|
|
54
|
-
return '
|
|
54
|
+
return 'privacy';
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
if (known.lists.includes(part)) {
|
|
58
|
-
return '
|
|
58
|
+
return 'lists';
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
if (known.header.includes(part)) {
|
package/lib/menu.test.mjs
CHANGED
|
@@ -7,92 +7,92 @@ import assert from 'node:assert/strict';
|
|
|
7
7
|
import { currentPart, menuTree, currentPlace } from './menu.mjs';
|
|
8
8
|
|
|
9
9
|
const known = {
|
|
10
|
-
lists: ['
|
|
11
|
-
header: ['menu', '
|
|
12
|
-
partScreens: ['
|
|
10
|
+
lists: ['testimonials', 'cookies', 'priser'],
|
|
11
|
+
header: ['menu', 'mobile-menu', 'header-button'],
|
|
12
|
+
partScreens: ['privacy'],
|
|
13
13
|
cookies: 'cookies',
|
|
14
|
-
store: '
|
|
14
|
+
store: 'settings/appstore',
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
const treeGroups = [
|
|
18
18
|
{ id: 'home', title: 'Home', href: '#', ids: [] },
|
|
19
|
-
{ id: '
|
|
20
|
-
{ id: '
|
|
19
|
+
{ id: 'content', title: 'Content', ids: ['pages', 'lists', 'redirects'] },
|
|
20
|
+
{ id: 'appearance', title: 'Appearance', ids: ['appearance/colors', 'appearance/logo'] },
|
|
21
21
|
];
|
|
22
|
-
const treePartOf = (id) => ({ label: `L ${id}`, href: `#${id === '
|
|
22
|
+
const treePartOf = (id) => ({ label: `L ${id}`, href: `#${id === 'redirects' ? 'seo/redirects' : id}`, count: null });
|
|
23
23
|
const treeChildren = (id) =>
|
|
24
|
-
id === '
|
|
24
|
+
id === 'redirects'
|
|
25
25
|
? [
|
|
26
|
-
{ id: '
|
|
27
|
-
{ id: '
|
|
26
|
+
{ id: 'all', label: 'All', href: '#seo/redirects/all' },
|
|
27
|
+
{ id: 'not-found', label: 'Not found', href: '#seo/redirects/not-found' },
|
|
28
28
|
]
|
|
29
|
-
: id === '
|
|
30
|
-
? [{ id: 'priser', label: 'Prices', href: '#
|
|
29
|
+
: id === 'lists'
|
|
30
|
+
? [{ id: 'priser', label: 'Prices', href: '#list/priser' }]
|
|
31
31
|
: [];
|
|
32
32
|
const tree = menuTree(treeGroups, treePartOf, treeChildren);
|
|
33
33
|
|
|
34
34
|
test('an open collection is its own item', () => {
|
|
35
35
|
assert.equal(currentPart('src/content/pages/om.md', { ...known, open: 'pages' }), 'pages');
|
|
36
|
-
assert.equal(currentPart('
|
|
36
|
+
assert.equal(currentPart('list/blog', { ...known, open: 'blog' }), 'blog');
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
test('a short list is under Lists', () => {
|
|
40
|
-
assert.equal(currentPart('
|
|
41
|
-
assert.equal(currentPart('
|
|
42
|
-
assert.equal(currentPart('
|
|
43
|
-
assert.equal(currentPart('src/data/prices/a.json', { ...known, open: 'priser' }), '
|
|
40
|
+
assert.equal(currentPart('list/testimonials', known), 'lists');
|
|
41
|
+
assert.equal(currentPart('new/testimonials', known), 'lists');
|
|
42
|
+
assert.equal(currentPart('deleted/priser', known), 'lists');
|
|
43
|
+
assert.equal(currentPart('src/data/prices/a.json', { ...known, open: 'priser' }), 'lists');
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
test('the cookie list is under Privacy, whatever the way to it', () => {
|
|
47
|
-
assert.equal(currentPart('
|
|
48
|
-
assert.equal(currentPart('
|
|
49
|
-
assert.equal(currentPart('
|
|
50
|
-
assert.equal(currentPart('
|
|
51
|
-
assert.equal(currentPart('src/data/cookie-list/a.json', { ...known, open: 'cookies' }), '
|
|
47
|
+
assert.equal(currentPart('list/cookies', known), 'privacy');
|
|
48
|
+
assert.equal(currentPart('list/cookies/cookiescanner', known), 'privacy');
|
|
49
|
+
assert.equal(currentPart('new/cookies', known), 'privacy');
|
|
50
|
+
assert.equal(currentPart('deleted/cookies', known), 'privacy');
|
|
51
|
+
assert.equal(currentPart('src/data/cookie-list/a.json', { ...known, open: 'cookies' }), 'privacy');
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
test('the menus are under Header', () => {
|
|
55
55
|
assert.equal(currentPart('src/data/menu.json', { ...known, open: 'menu' }), 'header');
|
|
56
|
-
assert.equal(currentPart('
|
|
57
|
-
assert.equal(currentPart('src/data/header.json', { ...known, open: '
|
|
56
|
+
assert.equal(currentPart('list/mobile-menu', known), 'header');
|
|
57
|
+
assert.equal(currentPart('src/data/header.json', { ...known, open: 'header-button' }), 'header');
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
test('a screen under a part is that part', () => {
|
|
61
|
-
assert.equal(currentPart('
|
|
62
|
-
assert.equal(currentPart('
|
|
63
|
-
assert.equal(currentPart('
|
|
64
|
-
assert.equal(currentPart('
|
|
65
|
-
assert.equal(currentPart('
|
|
66
|
-
assert.equal(currentPart('seo/
|
|
61
|
+
assert.equal(currentPart('company', known), 'company');
|
|
62
|
+
assert.equal(currentPart('company/payment/mobilepay', known), 'company');
|
|
63
|
+
assert.equal(currentPart('blocks', known), 'blocks');
|
|
64
|
+
assert.equal(currentPart('blocks/hero', known), 'blocks');
|
|
65
|
+
assert.equal(currentPart('appearance/colors', known), 'appearance');
|
|
66
|
+
assert.equal(currentPart('seo/redirects', known), 'seo');
|
|
67
67
|
assert.equal(currentPart('apps/calendly', known), 'apps');
|
|
68
|
-
assert.equal(currentPart('apps/calendly/
|
|
68
|
+
assert.equal(currentPart('apps/calendly/settings', known), 'apps');
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
test('Block settings is not under Block templates, and a longer name is not under a shorter one', () => {
|
|
72
|
-
assert.equal(currentPart('
|
|
72
|
+
assert.equal(currentPart('block-settings', known), 'block-settings');
|
|
73
73
|
assert.equal(currentPart('appsx', known), 'appsx');
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
test('the screens with parts, and their parts, are the screen', () => {
|
|
77
|
-
assert.equal(currentPart('
|
|
78
|
-
assert.equal(currentPart('
|
|
77
|
+
assert.equal(currentPart('privacy', known), 'privacy');
|
|
78
|
+
assert.equal(currentPart('privacy/cookie-banner', known), 'privacy');
|
|
79
79
|
});
|
|
80
80
|
|
|
81
81
|
test('the app store, and its themes, are Find apps', () => {
|
|
82
|
-
assert.equal(currentPart('
|
|
83
|
-
assert.equal(currentPart('
|
|
82
|
+
assert.equal(currentPart('settings/appstore', known), 'appstore');
|
|
83
|
+
assert.equal(currentPart('settings/appstore/themes', known), 'appstore');
|
|
84
84
|
});
|
|
85
85
|
|
|
86
86
|
test('a screen of its own is itself, and the start screen is none', () => {
|
|
87
|
-
assert.equal(currentPart('
|
|
88
|
-
assert.equal(currentPart('
|
|
87
|
+
assert.equal(currentPart('advanced', known), 'advanced');
|
|
88
|
+
assert.equal(currentPart('licenses', known), 'licenses');
|
|
89
89
|
assert.equal(currentPart('', known), '');
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
test('menuTree keeps the groups in the order written', () => {
|
|
93
93
|
assert.deepEqual(
|
|
94
94
|
tree.map((e) => e.id),
|
|
95
|
-
['home', '
|
|
95
|
+
['home', 'content', 'appearance'],
|
|
96
96
|
);
|
|
97
97
|
});
|
|
98
98
|
|
|
@@ -105,7 +105,7 @@ test('menuTree copies href only when the group has it', () => {
|
|
|
105
105
|
test('menuTree gives the items in the order written', () => {
|
|
106
106
|
assert.deepEqual(
|
|
107
107
|
tree[1].items.map((i) => i.id),
|
|
108
|
-
['pages', '
|
|
108
|
+
['pages', 'lists', 'redirects'],
|
|
109
109
|
);
|
|
110
110
|
assert.equal(tree[1].items[0].label, 'L pages');
|
|
111
111
|
});
|
|
@@ -120,23 +120,23 @@ test('currentPlace on the start screen is no section', () => {
|
|
|
120
120
|
});
|
|
121
121
|
|
|
122
122
|
test('currentPlace finds a child', () => {
|
|
123
|
-
assert.deepEqual(currentPlace('seo/
|
|
123
|
+
assert.deepEqual(currentPlace('seo/redirects/all', tree, known), { section: 'content', item: 'redirects', child: 'all' });
|
|
124
124
|
});
|
|
125
125
|
|
|
126
126
|
test('currentPlace finds a list as a child of Lists', () => {
|
|
127
|
-
assert.deepEqual(currentPlace('
|
|
127
|
+
assert.deepEqual(currentPlace('list/priser', tree, known), { section: 'content', item: 'lists', child: 'priser' });
|
|
128
128
|
});
|
|
129
129
|
|
|
130
130
|
test('currentPlace finds an item by its href', () => {
|
|
131
|
-
assert.deepEqual(currentPlace('seo/
|
|
131
|
+
assert.deepEqual(currentPlace('seo/redirects', tree, known), { section: 'content', item: 'redirects' });
|
|
132
132
|
});
|
|
133
133
|
|
|
134
134
|
test('currentPlace finds a screen under an item', () => {
|
|
135
|
-
assert.deepEqual(currentPlace('
|
|
135
|
+
assert.deepEqual(currentPlace('appearance/colors/tekst', tree, known), { section: 'appearance', item: 'appearance/colors' });
|
|
136
136
|
});
|
|
137
137
|
|
|
138
138
|
test('currentPlace falls back to currentPart', () => {
|
|
139
|
-
assert.deepEqual(currentPlace('rediger/pages/app-store', tree, { ...known, open: 'pages' }), { section: '
|
|
139
|
+
assert.deepEqual(currentPlace('rediger/pages/app-store', tree, { ...known, open: 'pages' }), { section: 'content', item: 'pages' });
|
|
140
140
|
});
|
|
141
141
|
|
|
142
142
|
test('currentPlace gives no section for an unknown route', () => {
|
|
@@ -144,82 +144,82 @@ test('currentPlace gives no section for an unknown route', () => {
|
|
|
144
144
|
});
|
|
145
145
|
|
|
146
146
|
test('currentPlace gives the section of a screen that is a section itself', () => {
|
|
147
|
-
assert.deepEqual(currentPlace('
|
|
147
|
+
assert.deepEqual(currentPlace('appearance', tree, known), { section: 'appearance' });
|
|
148
148
|
});
|
|
149
149
|
|
|
150
150
|
// The menu as defaults/editor.ts `groups` writes it, with the hrefs the editor gives.
|
|
151
151
|
const menuGroups = [
|
|
152
152
|
{ id: 'home', title: 'Home', href: '#', ids: [] },
|
|
153
153
|
{
|
|
154
|
-
id: '
|
|
154
|
+
id: 'content',
|
|
155
155
|
title: 'Content',
|
|
156
|
-
ids: ['pages', 'blog', '
|
|
156
|
+
ids: ['pages', 'blog', 'lists', 'popups', 'tags', 'files', 'internal-links', 'redirects'],
|
|
157
157
|
},
|
|
158
|
-
{ id: '
|
|
158
|
+
{ id: 'global', title: 'Global', ids: ['header', 'footer', 'company'] },
|
|
159
159
|
{ id: 'apps', title: 'Apps', ids: ['apps', 'appstore'] },
|
|
160
|
-
{ id: '
|
|
161
|
-
{ id: '
|
|
162
|
-
{ id: '
|
|
163
|
-
{ id: '
|
|
160
|
+
{ id: 'blocks', title: 'Blocks', ids: ['blocks', 'block-settings'] },
|
|
161
|
+
{ id: 'appearance', title: 'Appearance', ids: ['colors', 'logo'] },
|
|
162
|
+
{ id: 'privacy', title: 'Privacy', ids: ['cookie-banner', 'cookies'] },
|
|
163
|
+
{ id: 'settings', title: 'Settings', ids: ['advanced'] },
|
|
164
164
|
];
|
|
165
165
|
const hrefs = {
|
|
166
|
-
pages: '#
|
|
167
|
-
blog: '#
|
|
168
|
-
|
|
169
|
-
popups: '#
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
'
|
|
173
|
-
|
|
174
|
-
header: '#
|
|
175
|
-
footer: '#
|
|
176
|
-
|
|
166
|
+
pages: '#list/pages',
|
|
167
|
+
blog: '#list/blog',
|
|
168
|
+
lists: '#lists',
|
|
169
|
+
popups: '#list/popups',
|
|
170
|
+
tags: '#list/tags',
|
|
171
|
+
files: '#files',
|
|
172
|
+
'internal-links': '#seo/internal-links',
|
|
173
|
+
redirects: '#seo/redirects',
|
|
174
|
+
header: '#appearance/header',
|
|
175
|
+
footer: '#appearance/footer',
|
|
176
|
+
company: '#company',
|
|
177
177
|
apps: '#apps',
|
|
178
|
-
appstore: '#
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
logo: '#
|
|
183
|
-
|
|
184
|
-
cookies: '#
|
|
185
|
-
|
|
178
|
+
appstore: '#settings/appstore',
|
|
179
|
+
blocks: '#blocks',
|
|
180
|
+
'block-settings': '#block-settings',
|
|
181
|
+
colors: '#appearance/colors',
|
|
182
|
+
logo: '#appearance/logo',
|
|
183
|
+
'cookie-banner': '#privacy/cookie-banner',
|
|
184
|
+
cookies: '#list/cookies',
|
|
185
|
+
advanced: '#advanced',
|
|
186
186
|
};
|
|
187
187
|
const menu = menuTree(
|
|
188
188
|
menuGroups,
|
|
189
189
|
(id) => ({ label: id, href: hrefs[id], count: null }),
|
|
190
190
|
(id) =>
|
|
191
|
-
id === '
|
|
191
|
+
id === 'redirects'
|
|
192
192
|
? [
|
|
193
|
-
{ id: '
|
|
194
|
-
{ id: '
|
|
193
|
+
{ id: 'all', label: 'All', href: '#seo/redirects/all' },
|
|
194
|
+
{ id: 'not-found', label: 'Not found', href: '#seo/redirects/not-found' },
|
|
195
195
|
]
|
|
196
196
|
: id === 'apps'
|
|
197
197
|
? [{ id: 'calendly', label: 'Calendly', href: '#apps/calendly' }]
|
|
198
198
|
: [],
|
|
199
199
|
);
|
|
200
|
-
const menuKnown = { ...known, store: '
|
|
200
|
+
const menuKnown = { ...known, store: 'settings/appstore' };
|
|
201
201
|
const allIds = menu.flatMap((e) => e.items.flatMap((i) => [i.id, ...(i.children ?? []).map((c) => c.id)]));
|
|
202
202
|
const allHrefs = menu.flatMap((e) => e.items.flatMap((i) => [i.href, ...(i.children ?? []).map((c) => c.href)]));
|
|
203
203
|
|
|
204
204
|
test('the menu has the eight sections in order', () => {
|
|
205
205
|
assert.deepEqual(
|
|
206
206
|
menu.map((e) => e.id),
|
|
207
|
-
['home', '
|
|
207
|
+
['home', 'content', 'global', 'apps', 'blocks', 'appearance', 'privacy', 'settings'],
|
|
208
208
|
);
|
|
209
209
|
});
|
|
210
210
|
|
|
211
211
|
test('Content holds Internal links and Redirects after the files, in order', () => {
|
|
212
212
|
assert.deepEqual(
|
|
213
213
|
menu[1].items.map((i) => i.id),
|
|
214
|
-
['pages', 'blog', '
|
|
214
|
+
['pages', 'blog', 'lists', 'popups', 'tags', 'files', 'internal-links', 'redirects'],
|
|
215
215
|
);
|
|
216
216
|
});
|
|
217
217
|
|
|
218
218
|
test('Redirects has All and Not found as children', () => {
|
|
219
|
-
const redirects = menu[1].items.find((i) => i.id === '
|
|
219
|
+
const redirects = menu[1].items.find((i) => i.id === 'redirects');
|
|
220
220
|
assert.deepEqual(
|
|
221
221
|
redirects.children.map((c) => c.href),
|
|
222
|
-
['#seo/
|
|
222
|
+
['#seo/redirects/all', '#seo/redirects/not-found'],
|
|
223
223
|
);
|
|
224
224
|
});
|
|
225
225
|
|
|
@@ -230,51 +230,51 @@ test('Find apps is the first item under Apps, then the apps installed, and Advan
|
|
|
230
230
|
);
|
|
231
231
|
assert.deepEqual(
|
|
232
232
|
menu[7].items.map((i) => i.id),
|
|
233
|
-
['
|
|
233
|
+
['advanced'],
|
|
234
234
|
);
|
|
235
235
|
});
|
|
236
236
|
|
|
237
237
|
test('Analytics, SEO, the SEO rating and Licenses are not in the menu', () => {
|
|
238
|
-
for (const gone of ['
|
|
238
|
+
for (const gone of ['analytics', 'seo', 'rating', 'licenses']) {
|
|
239
239
|
assert.equal(allIds.includes(gone), false);
|
|
240
240
|
}
|
|
241
|
-
for (const gone of ['#
|
|
241
|
+
for (const gone of ['#analytics', '#seo', '#seo/rating', '#licenses']) {
|
|
242
242
|
assert.equal(allHrefs.includes(gone), false);
|
|
243
243
|
}
|
|
244
244
|
});
|
|
245
245
|
|
|
246
246
|
test('currentPlace of a page being edited, a list, the SEO rating, an Appearance screen, an app, Find apps and Privacy', () => {
|
|
247
|
-
assert.deepEqual(currentPlace('
|
|
248
|
-
assert.deepEqual(currentPlace('src/content/pages/om.md', menu, { ...menuKnown, open: 'pages' }), { section: '
|
|
249
|
-
assert.deepEqual(currentPlace('seo/
|
|
250
|
-
section: '
|
|
251
|
-
item: '
|
|
252
|
-
child: '
|
|
247
|
+
assert.deepEqual(currentPlace('list/pages/app-store', menu, menuKnown), { section: 'content', item: 'pages' });
|
|
248
|
+
assert.deepEqual(currentPlace('src/content/pages/om.md', menu, { ...menuKnown, open: 'pages' }), { section: 'content', item: 'pages' });
|
|
249
|
+
assert.deepEqual(currentPlace('seo/redirects/all', menu, menuKnown), {
|
|
250
|
+
section: 'content',
|
|
251
|
+
item: 'redirects',
|
|
252
|
+
child: 'all',
|
|
253
253
|
});
|
|
254
|
-
assert.deepEqual(currentPlace('seo/
|
|
255
|
-
assert.deepEqual(currentPlace('seo/
|
|
256
|
-
assert.deepEqual(currentPlace('
|
|
254
|
+
assert.deepEqual(currentPlace('seo/internal-links', menu, menuKnown), { section: 'content', item: 'internal-links' });
|
|
255
|
+
assert.deepEqual(currentPlace('seo/rating', menu, menuKnown), { section: null });
|
|
256
|
+
assert.deepEqual(currentPlace('appearance/colors', menu, menuKnown), { section: 'appearance', item: 'colors' });
|
|
257
257
|
assert.deepEqual(currentPlace('apps/calendly', menu, menuKnown), { section: 'apps', item: 'calendly' });
|
|
258
258
|
assert.deepEqual(currentPlace('apps/mailchimp', menu, menuKnown), { section: 'apps' });
|
|
259
|
-
assert.deepEqual(currentPlace('
|
|
260
|
-
assert.deepEqual(currentPlace('
|
|
261
|
-
assert.deepEqual(currentPlace('src/data/cookie-list/a.json', menu, { ...menuKnown, open: 'cookies' }), { section: '
|
|
259
|
+
assert.deepEqual(currentPlace('settings/appstore/themes', menu, menuKnown), { section: 'apps', item: 'appstore' });
|
|
260
|
+
assert.deepEqual(currentPlace('privacy/cookie-banner', menu, menuKnown), { section: 'privacy', item: 'cookie-banner' });
|
|
261
|
+
assert.deepEqual(currentPlace('src/data/cookie-list/a.json', menu, { ...menuKnown, open: 'cookies' }), { section: 'privacy' });
|
|
262
262
|
});
|
|
263
263
|
|
|
264
264
|
test('currentPlace of Appearance › Header and its menus is Global › Header', () => {
|
|
265
|
-
assert.deepEqual(currentPlace('
|
|
266
|
-
assert.deepEqual(currentPlace('src/data/menu.json', menu, { ...menuKnown, open: 'menu' }), { section: '
|
|
265
|
+
assert.deepEqual(currentPlace('appearance/header', menu, menuKnown), { section: 'global', item: 'header' });
|
|
266
|
+
assert.deepEqual(currentPlace('src/data/menu.json', menu, { ...menuKnown, open: 'menu' }), { section: 'global', item: 'header' });
|
|
267
267
|
});
|
|
268
268
|
|
|
269
269
|
test('currentPlace of Appearance › Footer is Global › Footer, a row without children', () => {
|
|
270
|
-
assert.deepEqual(currentPlace('
|
|
271
|
-
const global = menu.find((entry) => entry.id === '
|
|
270
|
+
assert.deepEqual(currentPlace('appearance/footer', menu, menuKnown), { section: 'global', item: 'footer' });
|
|
271
|
+
const global = menu.find((entry) => entry.id === 'global');
|
|
272
272
|
assert.equal(global.items.find((item) => item.id === 'footer').children, undefined);
|
|
273
273
|
assert.equal(global.items.find((item) => item.id === 'header').children, undefined);
|
|
274
274
|
});
|
|
275
275
|
|
|
276
276
|
const appsGroups = [{ id: 'apps', title: 'Apps', ids: ['apps', 'appstore'] }];
|
|
277
|
-
const appsPartOf = (id) => ({ label: `L ${id}`, href: id === 'appstore' ? '#
|
|
277
|
+
const appsPartOf = (id) => ({ label: `L ${id}`, href: id === 'appstore' ? '#settings/appstore' : '#apps', count: null });
|
|
278
278
|
const appsOf = (list) => (id) => (id === 'apps' ? list.map((a) => ({ id: a, label: `A ${a}`, href: `#apps/${a}` })) : []);
|
|
279
279
|
|
|
280
280
|
test('the Apps section lists Appstore, then each installed app, and not the apps list', () => {
|
|
@@ -300,5 +300,5 @@ test('an app screen selects its row; the apps list and Appstore keep the Apps se
|
|
|
300
300
|
const appsTree = menuTree(appsGroups, appsPartOf, appsOf(['mailchimp', 'mobilepay']));
|
|
301
301
|
assert.deepEqual(currentPlace('apps/mailchimp', appsTree, known), { section: 'apps', item: 'mailchimp' });
|
|
302
302
|
assert.deepEqual(currentPlace('apps', appsTree, known), { section: 'apps' });
|
|
303
|
-
assert.deepEqual(currentPlace('
|
|
303
|
+
assert.deepEqual(currentPlace('settings/appstore', appsTree, known), { section: 'apps', item: 'appstore' });
|
|
304
304
|
});
|
package/lib/scheduled.mjs
CHANGED
|
@@ -33,5 +33,5 @@ export function published(text) {
|
|
|
33
33
|
/** A file as a commit names it: `blogindlæg "x"`. */
|
|
34
34
|
export function nameOf(path) {
|
|
35
35
|
const kind = KINDS.find((k) => path.startsWith(`${k.dir}/`));
|
|
36
|
-
return `${kind?.name ?? '
|
|
36
|
+
return `${kind?.name ?? 'file'} "${path.slice((kind?.dir.length ?? -1) + 1).replace(/(\/index)?\.md$/, '')}"`;
|
|
37
37
|
}
|