Compare commits
291 Commits
v9.4.0
...
copilot-in
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a4e9fd8ff | ||
|
|
e77de75333 | ||
|
|
b00d7a077d | ||
|
|
582c09875e | ||
|
|
0c9b4a31ac | ||
|
|
e8fc53804c | ||
|
|
5b7486a355 | ||
|
|
d23e0833dc | ||
|
|
dacc6214b6 | ||
|
|
314cadb81e | ||
|
|
1e1c0cedb0 | ||
|
|
013324b3f0 | ||
|
|
62056753e4 | ||
|
|
6b018c0b65 | ||
|
|
ef9510d92d | ||
|
|
6d4cd4b0c2 | ||
|
|
e529f30a40 | ||
|
|
8b92a3306f | ||
|
|
5353d07fcb | ||
|
|
1f94ae165c | ||
|
|
dbd42ac1f9 | ||
|
|
1031088f85 | ||
|
|
fcbbe7f834 | ||
|
|
c58d0573c6 | ||
|
|
ba7a0225c1 | ||
|
|
65fd8b4a78 | ||
|
|
46af17eac2 | ||
|
|
2eb0b775a3 | ||
|
|
bf07f29698 | ||
|
|
a22219c1b4 | ||
|
|
ec326a74ca | ||
|
|
2246fbb933 | ||
|
|
fa6f7dcfe6 | ||
|
|
f83ed9b970 | ||
|
|
9ce70fe722 | ||
|
|
4a1b37ba88 | ||
|
|
5882853f28 | ||
|
|
0b8155a75f | ||
|
|
19a0f4b53f | ||
|
|
0bde5610c5 | ||
|
|
b90f2adb18 | ||
|
|
a70b4316f8 | ||
|
|
16453cbb21 | ||
|
|
46e90df501 | ||
|
|
d8d72980ea | ||
|
|
7a5e452602 | ||
|
|
beee186d72 | ||
|
|
64fc1e4b76 | ||
|
|
5c4a716367 | ||
|
|
31873bc2d2 | ||
|
|
0e92834517 | ||
|
|
d262518023 | ||
|
|
da2cf68f5c | ||
|
|
2e7ece44e2 | ||
|
|
c039d260dc | ||
|
|
2fc543f0dd | ||
|
|
48314b3f3f | ||
|
|
a43b581e1b | ||
|
|
1ad55cdbbb | ||
|
|
ffa70050eb | ||
|
|
e8f70c78fd | ||
|
|
504774a4c8 | ||
|
|
a764c2fea7 | ||
|
|
5f623689cc | ||
|
|
54bf408c76 | ||
|
|
03f2284dd2 | ||
|
|
f637def278 | ||
|
|
da46374fb4 | ||
|
|
dee732f3ee | ||
|
|
d3b93424d1 | ||
|
|
a467791eaf | ||
|
|
70a5de960f | ||
|
|
31e27f63c1 | ||
|
|
a50f567fbb | ||
|
|
bdafd25cfe | ||
|
|
18b7708367 | ||
|
|
3fedaf7d5f | ||
|
|
75a3fc21a3 | ||
|
|
82b894c35b | ||
|
|
60952a05ac | ||
|
|
a571b34724 | ||
|
|
f46e4999a1 | ||
|
|
f9138cb3c3 | ||
|
|
893c46362e | ||
|
|
9136841b30 | ||
|
|
0e21093f92 | ||
|
|
3abd9589f1 | ||
|
|
81265e3c49 | ||
|
|
f6fd57e126 | ||
|
|
20d613452f | ||
|
|
35a6c8bada | ||
|
|
0b7f58d0ab | ||
|
|
c859874470 | ||
|
|
d70d2284b4 | ||
|
|
03236da793 | ||
|
|
07935aec73 | ||
|
|
f64c8c5958 | ||
|
|
c4267a69fa | ||
|
|
34b331b0ee | ||
|
|
5d0fc4f605 | ||
|
|
169f4ef14a | ||
|
|
7ea386328c | ||
|
|
c17400ce6d | ||
|
|
7b20d9f23d | ||
|
|
449bb110c2 | ||
|
|
0d3a99abe6 | ||
|
|
d2b9307a65 | ||
|
|
3842777f71 | ||
|
|
3a74c14ba6 | ||
|
|
a5ac7379bc | ||
|
|
c245e1474c | ||
|
|
c82c081fce | ||
|
|
31e344f358 | ||
|
|
366ae82318 | ||
|
|
c1a0609216 | ||
|
|
87bdabf515 | ||
|
|
0ae7cb27ce | ||
|
|
15870bcc99 | ||
|
|
5e77419f5a | ||
|
|
ec9f55b982 | ||
|
|
fdcfdc971d | ||
|
|
2bc103026b | ||
|
|
e0cdc5cf65 | ||
|
|
f39b707e30 | ||
|
|
23b1efec55 | ||
|
|
dd13d8779c | ||
|
|
6f6015cf83 | ||
|
|
afd2878428 | ||
|
|
c66deb032c | ||
|
|
4c079b3e9d | ||
|
|
03c2cd31d7 | ||
|
|
d1dba01923 | ||
|
|
2a8d7b0ebe | ||
|
|
3b26944a4a | ||
|
|
78cac94dd6 | ||
|
|
9c6845ed8a | ||
|
|
286ac4adfe | ||
|
|
7633ac91be | ||
|
|
282527c90d | ||
|
|
07fbf8bdb9 | ||
|
|
6e2633572a | ||
|
|
2e35da3d91 | ||
|
|
2bd607b13c | ||
|
|
106f1e6c94 | ||
|
|
54cd3ead64 | ||
|
|
7e9bd5b0ce | ||
|
|
9086868817 | ||
|
|
4bff53299e | ||
|
|
ee101cfe4d | ||
|
|
247051f592 | ||
|
|
e6b6bba7df | ||
|
|
be5d15d2f8 | ||
|
|
65364b8486 | ||
|
|
6dd82bd4fe | ||
|
|
e0b18465dc | ||
|
|
661efcf23f | ||
|
|
152f36e352 | ||
|
|
08697abba4 | ||
|
|
0a530dce27 | ||
|
|
63e296d62f | ||
|
|
003d93b0f2 | ||
|
|
59528a3db0 | ||
|
|
c298f2fd69 | ||
|
|
b02a80c28e | ||
|
|
f19bd07359 | ||
|
|
83b9f2380e | ||
|
|
3f88b05a1c | ||
|
|
48ada1c352 | ||
|
|
a8777c4032 | ||
|
|
fe5df3779b | ||
|
|
91ec23e77c | ||
|
|
1b0a99b8fb | ||
|
|
4a0c1a4059 | ||
|
|
40c722e380 | ||
|
|
41a5e9ab7a | ||
|
|
a641aabc2a | ||
|
|
bc3b2c403d | ||
|
|
b4d2e4ea8b | ||
|
|
b1e87d4f57 | ||
|
|
241e660694 | ||
|
|
03bc7e72fd | ||
|
|
0aca8fed16 | ||
|
|
60b5d7d759 | ||
|
|
e12db5ec74 | ||
|
|
f1d345ebc2 | ||
|
|
e9af7e1793 | ||
|
|
49e7fe6377 | ||
|
|
cc375801c2 | ||
|
|
4a53a180a7 | ||
|
|
51ece235f8 | ||
|
|
36ac891c00 | ||
|
|
5f0fd29cca | ||
|
|
0428e561a8 | ||
|
|
bcba947c1d | ||
|
|
c2d3496152 | ||
|
|
7f1dc88bd4 | ||
|
|
83f4711103 | ||
|
|
0a8723c544 | ||
|
|
bdce486a24 | ||
|
|
6d6a53047a | ||
|
|
afb241ad6a | ||
|
|
4229d262ae | ||
|
|
6b92a6f8b4 | ||
|
|
183e77b77b | ||
|
|
da7d5e6854 | ||
|
|
8a08f54340 | ||
|
|
be54b6286f | ||
|
|
1315602bcc | ||
|
|
0ad0179a4b | ||
|
|
9d68797c95 | ||
|
|
ffaea3b55d | ||
|
|
4565ea75ae | ||
|
|
c4d3f76510 | ||
|
|
ce2bd06f6d | ||
|
|
a29a6600ab | ||
|
|
6cbf86f822 | ||
|
|
514272835a | ||
|
|
3c29df54c1 | ||
|
|
d06be0efa1 | ||
|
|
2375be9211 | ||
|
|
b5b7dcf6b5 | ||
|
|
c81d5240f4 | ||
|
|
06b8a579a8 | ||
|
|
460c4964f6 | ||
|
|
62b9f12494 | ||
|
|
accb069bab | ||
|
|
d869d15694 | ||
|
|
e54907daaf | ||
|
|
7b689326e3 | ||
|
|
4a4db839ab | ||
|
|
cc2c878c5c | ||
|
|
273af6d80f | ||
|
|
d59d9a98d5 | ||
|
|
11233ba449 | ||
|
|
83cf0eb8f5 | ||
|
|
bb2ba5dbe8 | ||
|
|
128644eade | ||
|
|
aced5c550f | ||
|
|
93b096ab3d | ||
|
|
4dd27ad98f | ||
|
|
01ae0b49cc | ||
|
|
313533d74d | ||
|
|
5f92ad33ff | ||
|
|
7240747e86 | ||
|
|
fbbfaa572e | ||
|
|
7c4aa1d63d | ||
|
|
6e84217458 | ||
|
|
b981ed6c4f | ||
|
|
b1380388b6 | ||
|
|
d70f983694 | ||
|
|
3eb23d7501 | ||
|
|
d22ebfa6ce | ||
|
|
cf96923d96 | ||
|
|
6150a34547 | ||
|
|
d45cd0d015 | ||
|
|
965fac68c9 | ||
|
|
e2837794f3 | ||
|
|
ae436e1a0e | ||
|
|
0d19abfa8f | ||
|
|
58d3c8e211 | ||
|
|
2117dab03e | ||
|
|
20ff578c3f | ||
|
|
3c29526d88 | ||
|
|
a9fb507b28 | ||
|
|
d5adc348a2 | ||
|
|
71ecca3b85 | ||
|
|
bb29fa344c | ||
|
|
c67a1f9870 | ||
|
|
c972325eff | ||
|
|
60c8dd6185 | ||
|
|
033baea418 | ||
|
|
72f830e474 | ||
|
|
624afe9029 | ||
|
|
e161fe23d5 | ||
|
|
51517c6a43 | ||
|
|
e7de1209c3 | ||
|
|
9fcdf75c89 | ||
|
|
430ce8940c | ||
|
|
5c8228bd17 | ||
|
|
577ff2f13a | ||
|
|
f9134f1167 | ||
|
|
42b5a4ac9e | ||
|
|
0657c6307f | ||
|
|
d4bef8a4e5 | ||
|
|
c3f51c6764 | ||
|
|
91f127ef94 | ||
|
|
6158971fd8 | ||
|
|
9d2cc7cd9f | ||
|
|
964c943e88 | ||
|
|
0a6e2fac36 | ||
|
|
2a8c3abac6 |
14
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -12,6 +12,7 @@ A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
@@ -23,16 +24,11 @@ A clear and concise description of what you expected to happen.
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
**Device:**
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
- OS: [e.g. iOS]
|
||||
- Front Matter CMS Version [e.g. 10.2.0]
|
||||
- Browser [e.g. chrome, safari]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
|
||||
46
.github/actions/localization/action.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
name: Localization sync
|
||||
description: Syncs the localization values from English to the other supported languages
|
||||
|
||||
inputs:
|
||||
TRANSLATION_API_KEY:
|
||||
description: 'The API key for the translation service'
|
||||
required: true
|
||||
TRANSLATION_API_LOCATION:
|
||||
description: 'The location of the translation service'
|
||||
required: true
|
||||
TRANSLATION_API_URL:
|
||||
description: 'The URL of the translation service'
|
||||
required: true
|
||||
PACKAGE_NAME:
|
||||
description: 'The name of the package to be uploaded'
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
registry-url: https://registry.npmjs.org/
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install the dependencies
|
||||
shell: bash
|
||||
run: npm ci
|
||||
|
||||
- name: Sync localization
|
||||
shell: bash
|
||||
run: npm run localization:sync
|
||||
env:
|
||||
TRANSLATION_API_KEY: ${{ inputs.TRANSLATION_API_KEY }}
|
||||
TRANSLATION_API_LOCATION: ${{ inputs.TRANSLATION_API_LOCATION }}
|
||||
TRANSLATION_API_URL: ${{ inputs.TRANSLATION_API_URL }}
|
||||
|
||||
- name: Remove the node_modules
|
||||
shell: bash
|
||||
run: rm -rf node_modules
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.PACKAGE_NAME }}
|
||||
path: .
|
||||
70
.github/workflows/release-beta.yml
vendored
@@ -5,19 +5,45 @@ on:
|
||||
- dev
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
PACKAGE_NAME: 'fm-localized'
|
||||
MS_URL: 'https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-front-matter-beta'
|
||||
VSX_URL: 'https://open-vsx.org/extension/eliostruyf/vscode-front-matter-beta'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: 'Build and release'
|
||||
localization:
|
||||
name: 'Localization'
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: Beta
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Localize the solution
|
||||
uses: ./.github/actions/localization
|
||||
with:
|
||||
TRANSLATION_API_KEY: ${{ secrets.TRANSLATION_API_KEY }}
|
||||
TRANSLATION_API_LOCATION: ${{ secrets.TRANSLATION_API_LOCATION }}
|
||||
TRANSLATION_API_URL: ${{ secrets.TRANSLATION_API_URL }}
|
||||
PACKAGE_NAME: ${{ env.PACKAGE_NAME }}
|
||||
|
||||
release-ms:
|
||||
name: 'Release to VSCode Marketplace'
|
||||
runs-on: ubuntu-latest
|
||||
needs: localization
|
||||
environment:
|
||||
name: 'MS - BETA'
|
||||
url: ${{ env.MS_URL }}
|
||||
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ env.PACKAGE_NAME }}
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
registry-url: https://registry.npmjs.org/
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install the dependencies
|
||||
run: npm ci
|
||||
@@ -25,15 +51,33 @@ jobs:
|
||||
- name: Prepare BETA
|
||||
run: node scripts/beta-release.js $GITHUB_RUN_ID
|
||||
|
||||
- name: Run localization sync
|
||||
run: npm run localization:sync
|
||||
env:
|
||||
TRANSLATION_API_KEY: ${{ secrets.TRANSLATION_API_KEY }}
|
||||
TRANSLATION_API_LOCATION: ${{ secrets.TRANSLATION_API_LOCATION }}
|
||||
TRANSLATION_API_URL: ${{ secrets.TRANSLATION_API_URL }}
|
||||
|
||||
- name: Publish
|
||||
run: npx @vscode/vsce publish -p ${{ secrets.VSCE_PAT }} --baseImagesUrl https://raw.githubusercontent.com/estruyf/vscode-front-matter/dev
|
||||
|
||||
release-vsx:
|
||||
name: 'Release to Open VSX'
|
||||
runs-on: ubuntu-latest
|
||||
needs: localization
|
||||
environment:
|
||||
name: 'Open VSX - BETA'
|
||||
url: ${{ env.VSX_URL }}
|
||||
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ env.PACKAGE_NAME }}
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
registry-url: https://registry.npmjs.org/
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install the dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Prepare BETA
|
||||
run: node scripts/beta-release.js $GITHUB_RUN_ID
|
||||
|
||||
- name: Publish to open-vsx.org
|
||||
run: npx ovsx publish -p ${{ secrets.OPEN_VSX_PAT }}
|
||||
|
||||
70
.github/workflows/release.yml
vendored
@@ -5,19 +5,45 @@ on:
|
||||
- published
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
PACKAGE_NAME: 'fm-localized'
|
||||
MS_URL: 'https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-front-matter'
|
||||
VSX_URL: 'https://open-vsx.org/extension/eliostruyf/vscode-front-matter'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: 'Build and release'
|
||||
localization:
|
||||
name: 'Localization'
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: Stable
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Localize the solution
|
||||
uses: ./.github/actions/localization
|
||||
with:
|
||||
TRANSLATION_API_KEY: ${{ secrets.TRANSLATION_API_KEY }}
|
||||
TRANSLATION_API_LOCATION: ${{ secrets.TRANSLATION_API_LOCATION }}
|
||||
TRANSLATION_API_URL: ${{ secrets.TRANSLATION_API_URL }}
|
||||
PACKAGE_NAME: ${{ env.PACKAGE_NAME }}
|
||||
|
||||
release-ms:
|
||||
name: 'Release to VSCode Marketplace'
|
||||
runs-on: ubuntu-latest
|
||||
needs: localization
|
||||
environment:
|
||||
name: 'MS - Stable'
|
||||
url: ${{ env.MS_URL }}
|
||||
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ env.PACKAGE_NAME }}
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
registry-url: https://registry.npmjs.org/
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install the dependencies
|
||||
run: npm ci
|
||||
@@ -25,15 +51,33 @@ jobs:
|
||||
- name: Prepare MAIN release
|
||||
run: node scripts/main-release.js
|
||||
|
||||
- name: Run localization sync
|
||||
run: npm run localization:sync
|
||||
env:
|
||||
TRANSLATION_API_KEY: ${{ secrets.TRANSLATION_API_KEY }}
|
||||
TRANSLATION_API_LOCATION: ${{ secrets.TRANSLATION_API_LOCATION }}
|
||||
TRANSLATION_API_URL: ${{ secrets.TRANSLATION_API_URL }}
|
||||
|
||||
- name: Publish
|
||||
run: npx @vscode/vsce publish -p ${{ secrets.VSCE_PAT }}
|
||||
|
||||
release-vsx:
|
||||
name: 'Release to Open VSX'
|
||||
runs-on: ubuntu-latest
|
||||
needs: localization
|
||||
environment:
|
||||
name: 'Open VSX - Stable'
|
||||
url: ${{ env.VSX_URL }}
|
||||
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ env.PACKAGE_NAME }}
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
registry-url: https://registry.npmjs.org/
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install the dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Prepare MAIN release
|
||||
run: node scripts/main-release.js
|
||||
|
||||
- name: Publish to open-vsx.org
|
||||
run: npx ovsx publish -p ${{ secrets.OPEN_VSX_PAT }}
|
||||
|
||||
8
.vscode/launch.json
vendored
@@ -10,7 +10,9 @@
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}", "--disable-extension=eliostruyf.vscode-front-matter"
|
||||
],
|
||||
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
|
||||
"preLaunchTask": "npm: build:ext"
|
||||
},
|
||||
@@ -19,7 +21,9 @@
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}", "--disable-extension=eliostruyf.vscode-front-matter"
|
||||
],
|
||||
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
|
||||
}
|
||||
]
|
||||
|
||||
18
.vscode/settings.json
vendored
@@ -1,5 +1,21 @@
|
||||
// Place your settings in this file to overwrite default and user settings.
|
||||
{
|
||||
"commitHelper.messages": [
|
||||
{
|
||||
"type": "👨💻 apps",
|
||||
"values": ["#search", "#profile"]
|
||||
},
|
||||
{
|
||||
"type": "⚙️ tasks",
|
||||
"values": ["#build", "#deploy", "#skip"]
|
||||
}
|
||||
],
|
||||
"workbench.colorCustomizations": {
|
||||
"titleBar.activeBackground": "#15c2cb",
|
||||
"titleBar.inactiveBackground": "#44ffd299",
|
||||
"titleBar.activeForeground": "#0E131F",
|
||||
"titleBar.inactiveForeground": "#0E131F99"
|
||||
},
|
||||
"files.exclude": {
|
||||
"out": false // set this to true to hide the "out" folder with the compiled JS files
|
||||
},
|
||||
@@ -8,8 +24,6 @@
|
||||
},
|
||||
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
|
||||
"typescript.tsc.autoDetect": "off",
|
||||
"eliostruyf.writingstyleguide.terms.isDisabled": true,
|
||||
"eliostruyf.writingstyleguide.biasFree.isDisabled": true,
|
||||
"squarl.groups": [
|
||||
{
|
||||
"id": "dashboard",
|
||||
|
||||
108
CHANGELOG.md
@@ -1,5 +1,113 @@
|
||||
# Change Log
|
||||
|
||||
## [10.3.0] - 2024-xx-xx
|
||||
|
||||
### ✨ New features
|
||||
|
||||
### 🎨 Enhancements
|
||||
|
||||
- [#819](https://github.com/estruyf/vscode-front-matter/issues/819): Added new extensibility support for media scripts
|
||||
- [#822](https://github.com/estruyf/vscode-front-matter/issues/822): Added docs to the panel & dashboard views
|
||||
|
||||
### 🐞 Fixes
|
||||
|
||||
## [10.2.0] - 2024-06-12 - [Release notes](https://beta.frontmatter.codes/updates/v10.2.0)
|
||||
|
||||
### ✨ New features
|
||||
|
||||
- [#797](https://github.com/estruyf/vscode-front-matter/issues/797): Adding common actions at the bottom of the snippet cards
|
||||
|
||||
### 🎨 Enhancements
|
||||
|
||||
- [#441](https://github.com/estruyf/vscode-front-matter/issues/441): Show input descriptions for snippet and data forms
|
||||
- [#442](https://github.com/estruyf/vscode-front-matter/issues/442): Hide sidebar on data view when data file is selected + show dropdown of data files
|
||||
- [#788](https://github.com/estruyf/vscode-front-matter/issues/788): Show a warning on setting update when it exists in an extended configuration
|
||||
- [#798](https://github.com/estruyf/vscode-front-matter/issues/798): Changed dialog to slide-over for the snippet forms
|
||||
- [#799](https://github.com/estruyf/vscode-front-matter/issues/799): Added `frontMatter.logging` setting to define the logging output. Options are `info`, `warn`, `error`, and `verbose`. The default is `info`.
|
||||
- [#800](https://github.com/estruyf/vscode-front-matter/issues/800): Add colors for the Front Matter CMS output
|
||||
- [#808](https://github.com/estruyf/vscode-front-matter/issues/808): Add support to generate field groups and `block` fields in content type generation
|
||||
- [#810](https://github.com/estruyf/vscode-front-matter/issues/810): Update the tab title based on the view
|
||||
- [#811](https://github.com/estruyf/vscode-front-matter/issues/811): Added `panel.gitActions` view mode option to hide the Git actions in the panel
|
||||
- [#812](https://github.com/estruyf/vscode-front-matter/issues/812): Added the `{{locale}}` placeholder, which can be used in the `previewPath` property
|
||||
|
||||
### ⚡️ Optimizations
|
||||
|
||||
- [#802](https://github.com/estruyf/vscode-front-matter/issues/802): Update `glob` to the latest version and remove the sync method
|
||||
|
||||
### 🐞 Fixes
|
||||
|
||||
- [#796](https://github.com/estruyf/vscode-front-matter/issues/796): Fix issue in retrieving folders/files on dashboard load
|
||||
- [#801](https://github.com/estruyf/vscode-front-matter/issues/801): Faster folder processing on updates
|
||||
- [#804](https://github.com/estruyf/vscode-front-matter/issues/804): Fix blinking of the front matter content area
|
||||
- [#806](https://github.com/estruyf/vscode-front-matter/issues/804): Fix preview URL for `index.md` files in root of the page folder path
|
||||
- [#809](https://github.com/estruyf/vscode-front-matter/issues/809): Fix retrieving the `filePrefix` when updating the file name on slug change
|
||||
|
||||
## [10.1.0] - 2024-04-11 - [Release notes](https://beta.frontmatter.codes/updates/v10.1.0)
|
||||
|
||||
### ✨ New features
|
||||
|
||||
- [#671](https://github.com/estruyf/vscode-front-matter/issues/671): Command bar for contents and media dashboard
|
||||
|
||||
### 🎨 Enhancements
|
||||
|
||||
- [#773](https://github.com/estruyf/vscode-front-matter/issues/773): Added the ability to rename content files
|
||||
- [#777](https://github.com/estruyf/vscode-front-matter/issues/777): Show an error in the metadata panel if something went wrong while parsing the front matter
|
||||
- [#778](https://github.com/estruyf/vscode-front-matter/issues/778): Added the ability to open a file or webpage when custom scripts is completed
|
||||
- [#783](https://github.com/estruyf/vscode-front-matter/issues/783): Always show the custom panel view
|
||||
- [#785](https://github.com/estruyf/vscode-front-matter/issues/785): Adding common actions at the bottom of the content and media cards
|
||||
- [#787](https://github.com/estruyf/vscode-front-matter/issues/787): Support for glob patterns in the page folder paths
|
||||
- [#790](https://github.com/estruyf/vscode-front-matter/pull/790): Updated Japanese translations thanks to [mayumihara](https://github.com/mayumih387)
|
||||
|
||||
### 🐞 Fixes
|
||||
|
||||
- [#716](https://github.com/estruyf/vscode-front-matter/issues/716): Fix `dataFile` dropdown class
|
||||
- [#768](https://github.com/estruyf/vscode-front-matter/issues/768): Update broken link to the documentation
|
||||
- [#771](https://github.com/estruyf/vscode-front-matter/issues/771): Fix lowercase `data` tab label
|
||||
- [#782](https://github.com/estruyf/vscode-front-matter/issues/782): Fix for setting the correct view when inserting media or snippets
|
||||
- [#786](https://github.com/estruyf/vscode-front-matter/issues/786): Remove on startup as VSCode now triggers on known commands
|
||||
|
||||
## [10.0.2] - 2024-03-01
|
||||
|
||||
### 🐞 Fixes
|
||||
|
||||
- [#769](https://github.com/estruyf/vscode-front-matter/issues/769): Fix to remove internal properties for content folders
|
||||
|
||||
## [10.0.1] - 2024-02-28
|
||||
|
||||
### 🐞 Fixes
|
||||
|
||||
- [#766](https://github.com/estruyf/vscode-front-matter/issues/766): Fix for snippet placeholder retrieval
|
||||
|
||||
## [10.0.0] - 2024-02-28 - [Release notes](https://beta.frontmatter.codes/updates/v10.0.0)
|
||||
|
||||
### ✨ New features
|
||||
|
||||
- [#731](https://github.com/estruyf/vscode-front-matter/issues/731): Added the ability to map/unmap taxonomy to multiple pages at once
|
||||
- [#746](https://github.com/estruyf/vscode-front-matter/issues/746): Placeholder support added to to the `slug` field
|
||||
- [#749](https://github.com/estruyf/vscode-front-matter/issues/749): Ability to set your own filters on the content dashboard with the `frontMatter.content.filters` setting
|
||||
- [#756](https://github.com/estruyf/vscode-front-matter/issues/756): i18n/multilingual content support
|
||||
|
||||
### 🎨 Enhancements
|
||||
|
||||
- [#673](https://github.com/estruyf/vscode-front-matter/pull/673): Added git settings to the welcome view and settings view
|
||||
- [#727](https://github.com/estruyf/vscode-front-matter/pull/727): Updated Japanese translations thanks to [mayumihara](https://github.com/mayumih387)
|
||||
- [#737](https://github.com/estruyf/vscode-front-matter/issues/737): Optimize the grid layout of the content and media dashboards
|
||||
- [#739](https://github.com/estruyf/vscode-front-matter/pull/739): New Git settings to disable and require a commit message
|
||||
- [#741](https://github.com/estruyf/vscode-front-matter/issues/741): Added message on the content dashboard when content is processed
|
||||
- [#747](https://github.com/estruyf/vscode-front-matter/issues/747): The `@frontmatter/extensibility` dependency now supports scripts for placeholders
|
||||
- [#752](https://github.com/estruyf/vscode-front-matter/issues/752): Placeholder support in default `list` field values
|
||||
- Support for using the `fieldCollection` field in a `block` field
|
||||
- Updated the list of commands which are available in the command palette
|
||||
|
||||
### 🐞 Fixes
|
||||
|
||||
- [#721](https://github.com/estruyf/vscode-front-matter/issues/721): Fix keywords regex to support unicode characters
|
||||
- [#725](https://github.com/estruyf/vscode-front-matter/issues/725): Fix for opening menu of pinned items
|
||||
- [#730](https://github.com/estruyf/vscode-front-matter/issues/730): Add debounce to the input fields
|
||||
- [#738](https://github.com/estruyf/vscode-front-matter/issues/738): Fix when re-opening the preview after closing it
|
||||
- [#743](https://github.com/estruyf/vscode-front-matter/issues/743): Fix for storing data in YAML data files
|
||||
- [#745](https://github.com/estruyf/vscode-front-matter/issues/745): Fix for date field values in `block` field type
|
||||
|
||||
## [9.4.0] - 2023-12-12 - [Release notes](https://beta.frontmatter.codes/updates/v9.4.0)
|
||||
|
||||
### ✨ New features
|
||||
|
||||
@@ -54,6 +54,12 @@ A couple of our extension highlights that hopefully get you interested in giving
|
||||
|
||||
> If you see something missing in your article creation flow, please feel free to reach out.
|
||||
|
||||
**Version 10**
|
||||
|
||||
In version 10, we introduced the new i18n/multilingual support for your content. You can now manage your content in multiple languages, more information can be found in the [multilingual](https://frontmatter.codes/docs/content-creation/multilingual) section of our documentation.
|
||||
|
||||

|
||||
|
||||
**Version 9**
|
||||
|
||||
The extension is now available in multiple languages: English, German, and Japanese. Want to add your language? Check out the [localization the extension](https://frontmatter.codes/docs/contributing#translating-the-extension).
|
||||
@@ -173,20 +179,49 @@ You can open showcase issues for the following things:
|
||||
</a>
|
||||
</p>
|
||||
|
||||
## 🖤 Backers & Sponsors 👇 🤘
|
||||
## 💚 Backers & Sponsors 👇 🤘
|
||||
|
||||
<p align="center">
|
||||
<img src="https://frontmatter.codes/api/img-sponsors" />
|
||||
<img src="https://frontmatter.codes/api/img-sponsors" alt="Front Matter sponsors" />
|
||||
</p>
|
||||
|
||||
<br />
|
||||
|
||||
<p align="center" title="Powered by Netlify">
|
||||
<a href="https://www.netlify.com?utm_source=vscode-frontmatter&utm_campaign=oss">
|
||||
<img src="https://frontmatter.codes/assets/sponsors/netlify-dark.png" alt="Deploys by Netlify" height="51px" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<br />
|
||||
|
||||
<p align="center">
|
||||
<a href="https://vercel.com/?utm_source=vscode-frontmatter&utm_campaign=oss">
|
||||
<img src="https://frontmatter.codes/assets/sponsors/powered-by-vercel.png" />
|
||||
</a>
|
||||
<a href="http://bejs.io/" title="Supported by the BEJS Community">
|
||||
<img src="https://frontmatter.codes/assets/sponsors/bejs-community.png" alt="Supported by the BEJS Community" height="50px"/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
## 📊 Telemetry
|
||||
|
||||
The Front Matter CMS extension collects telemetry data to help us build a better understand which features from the CMS are used. The extension respects the `telemetry.enableTelemetry` setting which you can learn more about in the [Visual Studio Code FAQ](https://aka.ms/vscode-remote/telemetry), or you can only disable it for the extension by configuring the `frontMatter.telemetry.disable` setting.
|
||||
|
||||
We only collect the following data:
|
||||
|
||||
- Type of event
|
||||
- Extension title (main or beta)
|
||||
- Extension version
|
||||
|
||||
No user-specific data is collected, you can check the telemetry implementation in the following files:
|
||||
|
||||
- [Telemetry class](https://github.com/estruyf/vscode-front-matter/blob/59528a3db01be8d34dc40638e6cf827090e31986/src/helpers/Telemetry.ts)
|
||||
- [Metrics API](https://github.com/FrontMatter/web-documentation-nextjs/blob/main/pages/api/metrics.ts)
|
||||
|
||||
For crash reports in the webviews, we make use of Sentry to help us understand what went wrong. This data is only used to fix issues and improve the extension. You can find more information about the Sentry implementation in the following files:
|
||||
|
||||
- [Sentry config](https://github.com/estruyf/vscode-front-matter/blob/63e296d62f11be73ac86d9e823084247952a7ddc/src/utils/sentryInit.ts)
|
||||
|
||||
> The user ip address is not collected.
|
||||
|
||||
## 🔑 License
|
||||
|
||||
[MIT](./LICENSE)
|
||||
|
||||
43
README.md
@@ -52,6 +52,12 @@ A couple of our extension highlights that hopefully get you interested in giving
|
||||
|
||||
> If you see something missing in your article creation flow, please feel free to reach out.
|
||||
|
||||
**Version 10**
|
||||
|
||||
In version 10, we introduced the new i18n/multilingual support for your content. You can now manage your content in multiple languages, more information can be found in the [multilingual](https://frontmatter.codes/docs/content-creation/multilingual) section of our documentation.
|
||||
|
||||

|
||||
|
||||
**Version 9**
|
||||
|
||||
The extension is now available in multiple languages: English, German, and Japanese. Want to add your language? Check out the [localization the extension](https://frontmatter.codes/docs/contributing#translating-the-extension).
|
||||
@@ -171,7 +177,7 @@ You can open showcase issues for the following things:
|
||||
</a>
|
||||
</p>
|
||||
|
||||
## 🖤 Backers & Sponsors 👇 🤘
|
||||
## 💚 Backers & Sponsors 👇 🤘
|
||||
|
||||
<p align="center">
|
||||
<img src="https://frontmatter.codes/api/img-sponsors" alt="Front Matter sponsors" />
|
||||
@@ -179,9 +185,17 @@ You can open showcase issues for the following things:
|
||||
|
||||
<br />
|
||||
|
||||
<p align="center" title="Powered by Vercel">
|
||||
<a href="https://vercel.com/?utm_source=vscode-frontmatter&utm_campaign=oss">
|
||||
<img src="https://frontmatter.codes/assets/sponsors/powered-by-vercel.png" alt="Powered by Vercel" />
|
||||
<p align="center" title="Support by run.events">
|
||||
<a href="https://run.events/?utm_source=frontmatter&utm_campaign=oss">
|
||||
<img src="https://frontmatter.codes/assets/sponsors/runevents-purple.webp" alt="run.events - Event Management Platform" height="50px" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<br />
|
||||
|
||||
<p align="center" title="Powered by Netlify">
|
||||
<a href="https://www.netlify.com?utm_source=vscode-frontmatter&utm_campaign=oss">
|
||||
<img src="https://frontmatter.codes/assets/sponsors/netlify-dark.png" alt="Deploys by Netlify" height="51px" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
@@ -193,6 +207,27 @@ You can open showcase issues for the following things:
|
||||
</a>
|
||||
</p>
|
||||
|
||||
## 📊 Telemetry
|
||||
|
||||
The Front Matter CMS extension collects telemetry data to help us build a better understand which features from the CMS are used. The extension respects the `telemetry.enableTelemetry` setting which you can learn more about in the [Visual Studio Code FAQ](https://aka.ms/vscode-remote/telemetry), or you can only disable it for the extension by configuring the `frontMatter.telemetry.disable` setting.
|
||||
|
||||
We only collect the following data:
|
||||
|
||||
- Type of event
|
||||
- Extension title (main or beta)
|
||||
- Extension version
|
||||
|
||||
No user-specific data is collected, you can check the telemetry implementation in the following files:
|
||||
|
||||
- [Telemetry class](https://github.com/estruyf/vscode-front-matter/blob/59528a3db01be8d34dc40638e6cf827090e31986/src/helpers/Telemetry.ts)
|
||||
- [Metrics API](https://github.com/FrontMatter/web-documentation-nextjs/blob/main/pages/api/metrics.ts)
|
||||
|
||||
For crash reports in the webviews, we make use of Sentry to help us understand what went wrong. This data is only used to fix issues and improve the extension. You can find more information about the Sentry implementation in the following files:
|
||||
|
||||
- [Sentry config](https://github.com/estruyf/vscode-front-matter/blob/63e296d62f11be73ac86d9e823084247952a7ddc/src/utils/sentryInit.ts)
|
||||
|
||||
> The user ip address is not collected.
|
||||
|
||||
## 🔑 License
|
||||
|
||||
[MIT](./LICENSE)
|
||||
|
||||
17
SUPPORT.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Support
|
||||
|
||||
This article provides information on how to get support for Front Matter CMS.
|
||||
|
||||
> 👉 Note: before participating in our community, please read our [code of conduct](./CODE_OF_CONDUCT.md). By interacting with this repository, organization, or community you agree to abide by its terms.
|
||||
|
||||
## Asking for help
|
||||
|
||||
There are a few different ways to ask for help with Front Matter CMS:
|
||||
|
||||
1. **GitHub Discussions**: You can ask questions and share your experiences in the [Discussions](https://github.com/estruyf/vscode-front-matter/discussions) section of this repository.
|
||||
2. **GitHub Issues**: If you encounter a bug or have a feature request, you can open an issue in the [Issues](https://github.com/estruyf/vscode-front-matter/issues) section of this repository.
|
||||
3. **Discord**: You can join our [Discord](https://discord.gg/JBVtNMsJFB) server and ask your questions there.
|
||||
|
||||
## Contributing
|
||||
|
||||
If you would like to contribute to Front Matter CMS, please read our [contributing guide](./CONTRIBUTING.md).
|
||||
3
assets/icons/i18n-dark.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="16" height="16" viewBox="0 0 24 24" stroke-width="2" stroke="#C5C5C5">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="m10.5 21 5.25-11.25L21 21m-9-3h7.5M3 5.621a48.474 48.474 0 0 1 6-.371m0 0c1.12 0 2.233.038 3.334.114M9 5.25V3m3.334 2.364C11.176 10.658 7.69 15.08 3 17.502m9.334-12.138c.896.061 1.785.147 2.666.257m-4.589 8.495a18.023 18.023 0 0 1-3.827-5.802" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 442 B |
3
assets/icons/i18n-light.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="16" height="16" viewBox="0 0 24 24" stroke-width="2" stroke="#424242">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="m10.5 21 5.25-11.25L21 21m-9-3h7.5M3 5.621a48.474 48.474 0 0 1 6-.371m0 0c1.12 0 2.233.038 3.334.114M9 5.25V3m3.334 2.364C11.176 10.658 7.69 15.08 3 17.502m9.334-12.138c.896.061 1.785.147 2.666.257m-4.589 8.495a18.023 18.023 0 0 1-3.827-5.802" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 442 B |
@@ -1,3 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5" viewBox="0 0 20 20" fill="#C5C5C5" width="16" height="16">
|
||||
<path fillRule="evenodd" d="M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z" clipRule="evenodd" />
|
||||
</svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" fill="#C5C5C5" width="16" height="16" class="w-6 h-6">
|
||||
<path fill-rule="evenodd" d="M1.5 6a2.25 2.25 0 0 1 2.25-2.25h16.5A2.25 2.25 0 0 1 22.5 6v12a2.25 2.25 0 0 1-2.25 2.25H3.75A2.25 2.25 0 0 1 1.5 18V6ZM3 16.06V18c0 .414.336.75.75.75h16.5A.75.75 0 0 0 21 18v-1.94l-2.69-2.689a1.5 1.5 0 0 0-2.12 0l-.88.879.97.97a.75.75 0 1 1-1.06 1.06l-5.16-5.159a1.5 1.5 0 0 0-2.12 0L3 16.061Zm10.125-7.81a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 269 B After Width: | Height: | Size: 555 B |
@@ -1,3 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5" viewBox="0 0 20 20" fill="#424242" width="16" height="16">
|
||||
<path fillRule="evenodd" d="M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z" clipRule="evenodd" />
|
||||
</svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" fill="#424242" width="16" height="16" class="w-6 h-6">
|
||||
<path fill-rule="evenodd" d="M1.5 6a2.25 2.25 0 0 1 2.25-2.25h16.5A2.25 2.25 0 0 1 22.5 6v12a2.25 2.25 0 0 1-2.25 2.25H3.75A2.25 2.25 0 0 1 1.5 18V6ZM3 16.06V18c0 .414.336.75.75.75h16.5A.75.75 0 0 0 21 18v-1.94l-2.69-2.689a1.5 1.5 0 0 0-2.12 0l-.88.879.97.97a.75.75 0 1 1-1.06 1.06l-5.16-5.159a1.5 1.5 0 0 0-2.12 0L3 16.061Zm10.125-7.81a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 269 B After Width: | Height: | Size: 555 B |
@@ -1,3 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="#C5C5C5" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M14.121 14.121L19 19m-7-7l7-7m-7 7l-2.879 2.879M12 12L9.121 9.121m0 5.758a3 3 0 10-4.243 4.243 3 3 0 004.243-4.243zm0-5.758a3 3 0 10-4.243-4.243 3 3 0 004.243 4.243z" />
|
||||
</svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" fill="#C5C5C5" width="16" height="16" class="w-6 h-6">
|
||||
<path fill-rule="evenodd" d="M8.128 9.155a3.751 3.751 0 1 1 .713-1.321l1.136.656a.75.75 0 0 1 .222 1.104l-.006.007a.75.75 0 0 1-1.032.157 1.421 1.421 0 0 0-.113-.072l-.92-.531Zm-4.827-3.53a2.25 2.25 0 0 1 3.994 2.063.756.756 0 0 0-.122.23 2.25 2.25 0 0 1-3.872-2.293ZM13.348 8.272a5.073 5.073 0 0 0-3.428 3.57 5.08 5.08 0 0 0-.165 1.202 1.415 1.415 0 0 1-.707 1.201l-.96.554a3.751 3.751 0 1 0 .734 1.309l13.729-7.926a.75.75 0 0 0-.181-1.374l-.803-.215a5.25 5.25 0 0 0-2.894.05l-5.325 1.629Zm-9.223 7.03a2.25 2.25 0 1 0 2.25 3.897 2.25 2.25 0 0 0-2.25-3.897ZM12 12.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z" clip-rule="evenodd" />
|
||||
<path d="M16.372 12.615a.75.75 0 0 1 .75 0l5.43 3.135a.75.75 0 0 1-.182 1.374l-.802.215a5.25 5.25 0 0 1-2.894-.051l-5.147-1.574a.75.75 0 0 1-.156-1.367l3-1.732Z" />
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 380 B After Width: | Height: | Size: 939 B |
@@ -1,3 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="#424242" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M14.121 14.121L19 19m-7-7l7-7m-7 7l-2.879 2.879M12 12L9.121 9.121m0 5.758a3 3 0 10-4.243 4.243 3 3 0 004.243-4.243zm0-5.758a3 3 0 10-4.243-4.243 3 3 0 004.243 4.243z" />
|
||||
</svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" fill="#424242" width="16" height="16" class="w-6 h-6">
|
||||
<path fill-rule="evenodd" d="M8.128 9.155a3.751 3.751 0 1 1 .713-1.321l1.136.656a.75.75 0 0 1 .222 1.104l-.006.007a.75.75 0 0 1-1.032.157 1.421 1.421 0 0 0-.113-.072l-.92-.531Zm-4.827-3.53a2.25 2.25 0 0 1 3.994 2.063.756.756 0 0 0-.122.23 2.25 2.25 0 0 1-3.872-2.293ZM13.348 8.272a5.073 5.073 0 0 0-3.428 3.57 5.08 5.08 0 0 0-.165 1.202 1.415 1.415 0 0 1-.707 1.201l-.96.554a3.751 3.751 0 1 0 .734 1.309l13.729-7.926a.75.75 0 0 0-.181-1.374l-.803-.215a5.25 5.25 0 0 0-2.894.05l-5.325 1.629Zm-9.223 7.03a2.25 2.25 0 1 0 2.25 3.897 2.25 2.25 0 0 0-2.25-3.897ZM12 12.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z" clip-rule="evenodd" />
|
||||
<path d="M16.372 12.615a.75.75 0 0 1 .75 0l5.43 3.135a.75.75 0 0 1-.182 1.374l-.802.215a5.25 5.25 0 0 1-2.894-.051l-5.147-1.574a.75.75 0 0 1-.156-1.367l3-1.732Z" />
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 380 B After Width: | Height: | Size: 939 B |
@@ -247,14 +247,6 @@
|
||||
background-color: var(--vscode-button-secondaryHoverBackground);
|
||||
}
|
||||
|
||||
.table__cell {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.table__title {
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
.table__cell__seo_details {
|
||||
padding: 10px;
|
||||
}
|
||||
@@ -281,11 +273,6 @@
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
|
||||
.seo__status__note {
|
||||
font-size: 10px;
|
||||
padding: 3px 0;
|
||||
}
|
||||
|
||||
/* Fields */
|
||||
.field__toggle {
|
||||
position: relative;
|
||||
@@ -364,7 +351,7 @@ input:checked + .field__toggle__slider:before {
|
||||
}
|
||||
|
||||
/* File list */
|
||||
.file_list vscode-label {
|
||||
.file_list label {
|
||||
border-bottom: 1px solid var(--vscode-foreground);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
import { By, VSBrowser, EditorView, WebView, Workbench, Notification, StatusBar, NotificationType } from "vscode-extension-tester";
|
||||
import { expect } from "chai";
|
||||
import { sleep } from "./utils";
|
||||
import { join } from "path";
|
||||
|
||||
// https://github.com/microsoft/vscode-java-dependency/blob/4256fa6adcaff5ec24dbdbb8d9a516fad21431c5/test/ui/index.ts
|
||||
// https://github.com/microsoft/vscode-java-dependency/blob/4256fa6adcaff5ec24dbdbb8d9a516fad21431c5/test/ui/command.test.ts
|
||||
|
||||
describe("Initialization testing", function() {
|
||||
this.timeout(2 * 60 * 1000 /*ms*/);
|
||||
|
||||
let workbench: Workbench;
|
||||
let view: WebView;
|
||||
|
||||
before(async function() {
|
||||
await VSBrowser.instance.openResources(join(__dirname, '../sample'));
|
||||
await sleep(3000);
|
||||
workbench = new Workbench();
|
||||
|
||||
await workbench.executeCommand("frontMatter.dashboard");
|
||||
await sleep(3000);
|
||||
|
||||
await new EditorView().openEditor(`FrontMatter Dashboard`);
|
||||
|
||||
view = new WebView();
|
||||
await view.switchToFrame();
|
||||
});
|
||||
|
||||
it("1. Open welcome dashboard", async function() {
|
||||
const element = await view.findWebElement(By.css('h1'));
|
||||
|
||||
const title = await element.getText();
|
||||
|
||||
expect(title).has.string(`Front Matter`);
|
||||
});
|
||||
|
||||
it("2. Initialize project", async function() {
|
||||
const btn = await view.findWebElement(By.css('[data-test="welcome-init"] button'));
|
||||
expect(btn).to.exist;
|
||||
|
||||
await btn.click();
|
||||
|
||||
await sleep(1000);
|
||||
|
||||
await VSBrowser.instance.driver.wait(() => {
|
||||
return notificationExists(workbench, 'Front Matter:');
|
||||
}, 2000) as Notification;
|
||||
|
||||
const notifications = await workbench.getNotifications();
|
||||
|
||||
let notification!: Notification;
|
||||
for (const not of notifications) {
|
||||
console.log(not);
|
||||
|
||||
// const message = await not.get;
|
||||
// console.log(message);
|
||||
// if (message.includes('Front Matter:')) {
|
||||
// notification = not;
|
||||
// }
|
||||
}
|
||||
|
||||
expect(await notification.getMessage()).has.string(`Project initialized successfully.`);
|
||||
});
|
||||
|
||||
it("3. Check if project file is created", async function() {});
|
||||
});
|
||||
|
||||
|
||||
async function notificationExists(workbench: Workbench, text: string): Promise<Notification | undefined> {
|
||||
const notifications = await (await (new StatusBar()).openNotificationsCenter()).getNotifications(NotificationType.Info);
|
||||
|
||||
for (const notification of notifications) {
|
||||
const message = await notification.getMessage();
|
||||
if (message.indexOf(text) >= 0) {
|
||||
return notification;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
import * as path from 'path'
|
||||
import * as semver from 'semver'
|
||||
import { ExTester, ReleaseQuality } from 'vscode-extension-tester'
|
||||
|
||||
async function main(): Promise<void> {
|
||||
const vsCodeVersion: semver.SemVer = new semver.SemVer(`1.66.0`)
|
||||
const version = vsCodeVersion.version
|
||||
|
||||
const storageFolder = path.join(__dirname, '..', 'storage')
|
||||
const extFolder = path.join(__dirname, '..', 'extensions')
|
||||
|
||||
try {
|
||||
const testPath = path.join(__dirname, 'command.test.js')
|
||||
|
||||
const exTester = new ExTester(storageFolder, ReleaseQuality.Stable, extFolder)
|
||||
await exTester.downloadCode(version)
|
||||
await exTester.installVsix({ useYarn: false })
|
||||
// await exTester.installFromMarketplace("eliostruyf.vscode-front-matter");
|
||||
await exTester.downloadChromeDriver(version)
|
||||
// await exTester.setupRequirements({vscodeVersion: version});
|
||||
const result = await exTester.runTests(testPath, {
|
||||
vscodeVersion: version,
|
||||
resources: [storageFolder],
|
||||
})
|
||||
|
||||
process.exit(result)
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
@@ -1 +0,0 @@
|
||||
export * from './sleep';
|
||||
@@ -1,3 +0,0 @@
|
||||
export async function sleep(time: number) {
|
||||
await new Promise((resolve) => setTimeout(resolve, time));
|
||||
}
|
||||
@@ -105,7 +105,7 @@
|
||||
"dashboard.header.tabs.contents": "Contenus",
|
||||
"dashboard.header.tabs.media": "Médias",
|
||||
"dashboard.header.tabs.snippets": "Snippets",
|
||||
"dashboard.header.tabs.data": "données",
|
||||
"dashboard.header.tabs.data": "Données",
|
||||
"dashboard.header.tabs.taxonomies": "Taxonomies",
|
||||
"dashboard.header.viewSwitch.toGrid": "Afficher en grille",
|
||||
"dashboard.header.viewSwitch.toList": "Afficher en liste",
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
"dashboard.header.tabs.contents": "Contenuto",
|
||||
"dashboard.header.tabs.media": "Media",
|
||||
"dashboard.header.tabs.snippets": "Snippets",
|
||||
"dashboard.header.tabs.data": "dati",
|
||||
"dashboard.header.tabs.data": "Dati",
|
||||
"dashboard.header.tabs.taxonomies": "Tassonomie",
|
||||
"dashboard.header.viewSwitch.toGrid": "Passa alla griglia",
|
||||
"dashboard.header.viewSwitch.toList": "Passa all'elenco",
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"common.edit": "編集",
|
||||
"common.delete": "削除",
|
||||
"common.cancel": "キャンセル",
|
||||
"common.apply": "適用",
|
||||
"common.clear": "クリア",
|
||||
"common.clear.value": "値をクリア",
|
||||
"common.search": "検索",
|
||||
@@ -20,38 +21,115 @@
|
||||
"common.slug": "スラッグ",
|
||||
"common.support": "サポート",
|
||||
"common.remove.value": "{0}を削除",
|
||||
"common.filter": "絞り込み",
|
||||
"common.filter.value": "{0}で絞り込み",
|
||||
"common.error.message": "申し訳ありません。エラーが発生しました。",
|
||||
"common.openOnWebsite": "ウェブサイトで開く",
|
||||
"common.settings": "設定",
|
||||
"common.refreshSettings": "設定の再読み込み",
|
||||
"common.pin": "ピン留めする",
|
||||
"common.unpin": "ピン留めを外す",
|
||||
"common.noResults": "結果なし",
|
||||
"common.error": "申し訳ありません。エラーが発生しました。",
|
||||
"common.yes": "はい",
|
||||
"common.no": "いいえ",
|
||||
"common.openSettings": "設定を開く",
|
||||
"common.back": "戻る",
|
||||
"common.open": "開く",
|
||||
"common.openWithValue": "開く: {0}",
|
||||
"common.openCustomActions": "カスタムコマンドを開く",
|
||||
"common.view": "表示",
|
||||
"common.translate": "翻訳する",
|
||||
"common.languages": "言語",
|
||||
"common.scripts": "スクリプト",
|
||||
"common.rename": "ファイル名を変更する",
|
||||
|
||||
"loading.initPages": "記事を読み込んでいます",
|
||||
|
||||
"notifications.outputChannel.link": "出力ウィンドウ",
|
||||
"notifications.outputChannel.description": "詳細は{0}を確認してください。",
|
||||
|
||||
"settings.view.common": "一般",
|
||||
"settings.view.contentFolders": "記事フォルダー",
|
||||
"settings.view.astro": "Astro",
|
||||
"settings.view.integration": "統合機能",
|
||||
|
||||
"settings.openOnStartup": "起動時にダッシュボードを開く",
|
||||
"settings.contentTypes": "記事タイプ",
|
||||
"settings.contentFolders": "記事フォルダー",
|
||||
"settings.diagnostic": "診断",
|
||||
"settings.diagnostic.description": "診断プログラムを実行して、Front Matter CMS構成全体を確認できます。",
|
||||
"settings.diagnostic.link": "完全診断を実行する",
|
||||
"settings.git": "Git同期",
|
||||
"settings.git.enabled": "Git同期を有効にして、変更内容をリポジトリと簡単に同期させます。",
|
||||
"settings.git.commitMessage": "コミットメッセージ",
|
||||
"settings.git.submoduleInfo": "Gitサブモジュールを使用している場合は、サブモジュールの設定についてドキュメントを参照してください。",
|
||||
"settings.git.submoduleLink": "Gitサブモジュールについて確認する",
|
||||
"settings.integration.title": "統合機能",
|
||||
|
||||
"settings.commonSettings.website.title": "ウェブサイトとSSGの設定",
|
||||
"settings.commonSettings.previewUrl": "プレビュー用URL",
|
||||
"settings.commonSettings.websiteUrl": "ウェブサイトのURL",
|
||||
"settings.commonSettings.startCommand": "SSG/フレームワーク起動コマンド",
|
||||
|
||||
"settings.integrationsView.deepl.title": "DeepL",
|
||||
"settings.integrationsView.deepl.intput.label": "API key",
|
||||
"settings.integrationsView.deepl.intput.placeholder": "DeepL API keyを入力",
|
||||
|
||||
"settings.integrationsView.azure.title": "Azure AI Translator",
|
||||
"settings.integrationsView.azure.intput.label": "サブスクリプションキー",
|
||||
"settings.integrationsView.azure.intput.placeholder": "Azure AI Translatorのサブスクリプションキーを入力",
|
||||
"settings.integrationsView.azure.region.label": "リージョン",
|
||||
"settings.integrationsView.azure.region.placeholder": "Azure AI Translatorのリージョンを入力 例: westeurope",
|
||||
|
||||
"developer.title": "開発モード",
|
||||
"developer.reload.title": "ダッシュボードを再読み込み",
|
||||
"developer.reload.label": "再読み込み",
|
||||
"developer.devTools.title": "開発ツールを開く",
|
||||
"developer.devTools.label": "開発ツール",
|
||||
|
||||
"field.required": "必須フィールド",
|
||||
"field.unknown": "不明なフィールド",
|
||||
|
||||
"dashboard.chatbot.answer.answer": "回答",
|
||||
"dashboard.chatbot.answer.resources": "参考",
|
||||
"dashboard.chatbot.answer.warning": "回答が正しくない場合もあります。内容がおかしいと思われる場合には、公式ドキュメントを確認してください。",
|
||||
|
||||
"dashboard.chatbot.chatbot.loading": "アシスタントを起動中",
|
||||
"dashboard.chatbot.chatbot.ready": "準備ができました。何について知りたいですか?",
|
||||
|
||||
"dashboard.chatbot.chatbox.placeholder": "Front Matterの設定方法は?",
|
||||
|
||||
"dashboard.chatbot.header.heading": "Front Matter AIに質問する",
|
||||
"dashboard.chatbot.header.description": "このAIはmendable.aiをベースに公式ドキュメントがチューニングされており、Front Matter関連のクエリを理解してあなたをアシストします。何でも聞いてください!",
|
||||
|
||||
"dashboard.common.choiceButton.open": "オプションを開く",
|
||||
|
||||
"dashboard.contents.contentActions.actionMenuButton.title": "メニュー",
|
||||
"dashboard.contents.contentActions.menuItem.view": "開く",
|
||||
"dashboard.contents.contentActions.alert.title": "削除: {0}",
|
||||
"dashboard.contents.contentActions.alert.description": "本当に\"{0}\"を削除しますか?",
|
||||
"dashboard.contents.contentActions.translations.create": "翻訳する",
|
||||
"dashboard.contents.contentActions.translations.menu": "翻訳版",
|
||||
|
||||
"dashboard.contents.item.invalidTitle": "<無効なタイトル>",
|
||||
"dashboard.contents.item.invalidDescription": "<無効なディスクリプション>",
|
||||
|
||||
"dashboard.contents.list.title": "タイトル",
|
||||
"dashboard.contents.list.date": "日付",
|
||||
"dashboard.contents.list.status": "ステータス",
|
||||
|
||||
"dashboard.contents.overview.noMarkdown": "Markdownファイルはありません",
|
||||
"dashboard.contents.overview.noFolders": "プロジェクト内の記事用フォルダーを登録して、Front Matterが記事を見つけられるようにしてください。",
|
||||
"dashboard.contents.overview.pinned": "ピン留めアイテム",
|
||||
|
||||
"dashboard.contents.status.draft": "下書き",
|
||||
"dashboard.contents.status.published": "公開済み",
|
||||
"dashboard.contents.status.scheduled": "予約済み",
|
||||
|
||||
"dashboard.dataView.dataForm.modify": "エントリーを編集",
|
||||
"dashboard.dataView.dataForm.add": "エントリーを作成",
|
||||
|
||||
"dashboard.dataView.dataView.select": "データタイプを選択",
|
||||
"dashboard.dataView.dataView.title": "\"{0}\"のエントリー",
|
||||
"dashboard.dataView.dataView.add": "新規エントリーを追加",
|
||||
@@ -60,34 +138,58 @@
|
||||
"dashboard.dataView.dataView.getStarted": "データタイプを選択して開始する",
|
||||
"dashboard.dataView.dataView.noDataFiles": "データファイルが見つかりませんでした",
|
||||
"dashboard.dataView.dataView.getStarted.link": "データファイルの利用方法について確認する",
|
||||
"dashboard.dataView.dataView.update.message": "データエントリーを更新しました。",
|
||||
|
||||
"dashboard.dataView.emptyView.heading": "最初にデータタイプを選んでください",
|
||||
|
||||
"dashboard.dataView.sortableItem.editButton.title": "\"{0}\"を編集する",
|
||||
"dashboard.dataView.sortableItem.deleteButton.title": "\"{0}\"を削除する",
|
||||
"dashboard.dataView.sortableItem.alert.title": "データアイテムを削除",
|
||||
"dashboard.dataView.sortableItem.alert.description": "本当にこのデータアイテムを削除しますか?",
|
||||
|
||||
"dashboard.errorView.description": "ダッシュボードを一旦閉じてからやり直してください。",
|
||||
|
||||
"dashboard.filters.languageFilter.label": "ロケール",
|
||||
"dashboard.filters.languageFilter.all": "全て",
|
||||
|
||||
"dashboard.header.actionsBar.itemsSelected": "{0}件を選択中",
|
||||
"dashboard.header.actionsBar.alertDelete.title": "選択ファイルを削除",
|
||||
"dashboard.header.actionsBar.alertDelete.description": "選択したファイルを本当に削除しますか?",
|
||||
|
||||
"dashboard.header.breadcrumb.home": "ホーム",
|
||||
"dashboard.header.clearFilters.title": "フィルター・グループ・並べ替えを解除",
|
||||
|
||||
"dashboard.header.clearFilters.title": "絞り込み・グループ・並べ替えを解除",
|
||||
|
||||
"dashboard.header.filter.default": "なし",
|
||||
|
||||
"dashboard.header.folders.default": "全ての記事タイプ",
|
||||
"dashboard.header.folders.menuButton.showing": "表示",
|
||||
|
||||
"dashboard.header.grouping.option.none": "なし",
|
||||
"dashboard.header.grouping.option.year": "公開年",
|
||||
"dashboard.header.grouping.option.draft": "下書き/公開済み",
|
||||
"dashboard.header.grouping.menuButton.label": "グループ",
|
||||
|
||||
"dashboard.header.navigation.allArticles": "全ての記事",
|
||||
"dashboard.header.navigation.published": "公開済み",
|
||||
"dashboard.header.navigation.scheduled": "予約済み",
|
||||
"dashboard.header.navigation.draft": "下書き",
|
||||
|
||||
"dashboard.header.header.createContent": "新しい記事を作成",
|
||||
"dashboard.header.header.createByContentType": "記事タイプから作成",
|
||||
"dashboard.header.header.createByTemplate": "テンプレートから作成",
|
||||
|
||||
"dashboard.header.pagination.first": "最初",
|
||||
"dashboard.header.pagination.previous": "前へ",
|
||||
"dashboard.header.pagination.next": "次へ",
|
||||
"dashboard.header.pagination.last": "最後",
|
||||
|
||||
"dashboard.header.paginationStatus.text": "{0}~{1}件目(全{2}件中)を表示中",
|
||||
|
||||
"dashboard.header.projectSwitcher.label": "プロジェクト",
|
||||
|
||||
"dashboard.header.refreshDashboard.label": "ダッシュボードを再読み込み",
|
||||
|
||||
"dashboard.header.sorting.lastModified.asc": "最終更新日(昇順)",
|
||||
"dashboard.header.sorting.lastModified.desc": "最終更新日(降順)",
|
||||
"dashboard.header.sorting.filename.asc": "ファイル名(昇順)",
|
||||
@@ -101,21 +203,27 @@
|
||||
"dashboard.header.sorting.alt.asc": "代替テキスト(昇順)",
|
||||
"dashboard.header.sorting.alt.desc": "代替テキスト(降順)",
|
||||
"dashboard.header.sorting.label": "並べ替え",
|
||||
|
||||
"dashboard.header.startup.label": "起動時に表示",
|
||||
|
||||
"dashboard.header.tabs.contents": "記事",
|
||||
"dashboard.header.tabs.media": "メディア",
|
||||
"dashboard.header.tabs.snippets": "スニペット",
|
||||
"dashboard.header.tabs.data": "データ",
|
||||
"dashboard.header.tabs.taxonomies": "タクソノミー",
|
||||
|
||||
"dashboard.header.viewSwitch.toGrid": "グリッド表示",
|
||||
"dashboard.header.viewSwitch.toList": "リスト表示",
|
||||
|
||||
"dashboard.layout.sponsor.support.msg": "Front Matterをサポートする",
|
||||
"dashboard.layout.sponsor.review.label": "評価する",
|
||||
"dashboard.layout.sponsor.review.msg": "Front Matterを評価する",
|
||||
|
||||
"dashboard.media.common.title": "タイトル",
|
||||
"dashboard.media.common.caption": "キャプション",
|
||||
"dashboard.media.common.alt": "代替テキスト",
|
||||
"dashboard.media.common.size": "サイズ",
|
||||
|
||||
"dashboard.media.dialog.title": "ファイルの詳細",
|
||||
"dashboard.media.panel.close": "パネルを閉じる",
|
||||
"dashboard.media.metadata.panel.title": "メタデータを編集",
|
||||
@@ -127,17 +235,27 @@
|
||||
"dashboard.media.metadata.panel.form.information.modifiedDate": "最終更新日",
|
||||
"dashboard.media.metadata.panel.form.information.dimensions": "ディメンション",
|
||||
"dashboard.media.metadata.panel.form.information.folder": "フォルダー",
|
||||
|
||||
"dashboard.media.folderCreation.hexo.create": "Assetフォルダーを作成",
|
||||
"dashboard.media.folderCreation.folder.create": "新規フォルダーを作成",
|
||||
|
||||
"dashboard.media.folderItem.contentDirectory": "コンテンツディレクトリー",
|
||||
"dashboard.media.folderItem.publicDirectory": "Publicディレクトリー",
|
||||
|
||||
"dashboard.media.item.buttom.insert.image": "画像を挿入",
|
||||
"dashboard.media.item.buttom.insert.snippet": "スニペットを挿入",
|
||||
|
||||
"dashboard.media.item.quickAction.insert.field": "この画像を\"{0}\"フィールドに追加",
|
||||
"dashboard.media.item.quickAction.insert.markdown": "画像をMarkdown記法で挿入",
|
||||
"dashboard.media.item.quickAction.copy.path": "ファイルパスをコピー",
|
||||
"dashboard.media.item.quickAction.delete": "ファイルを削除",
|
||||
"dashboard.media.item.menuItem.view": "メタデータの詳細を表示",
|
||||
"dashboard.media.item.menuItem.edit.metadata": "メタデータを編集",
|
||||
"dashboard.media.item.menuItem.insert.image": "画像を挿入",
|
||||
"dashboard.media.item.menuItem.reveal.media": "メディアの場所を表示",
|
||||
"dashboard.media.item.infoDialog.snippet.description": "このメディアに適用するメディア用スニペットを選択してください。",
|
||||
"dashboard.media.item.alert.delete.description": "本当にこのファイルを {0} から削除しますか?",
|
||||
|
||||
"dashboard.media.media.description": "記事に挿入するメディアファイルを選択してください。",
|
||||
"dashboard.media.media.dragAndDrop": "デスクトップから画像をドラッグ&ドロップして、アップロード後に選択することもできます。",
|
||||
"dashboard.media.media.folder.upload": "{0}にアップロードする",
|
||||
@@ -145,13 +263,19 @@
|
||||
"dashboard.media.media.placeholder": "メディアファイルはありません。Shiftキーを押しながら、新規ファイルをドラック&ドロップで追加することができます。",
|
||||
"dashboard.media.media.contentFolder": "記事フォルダー",
|
||||
"dashboard.media.media.publicFolder": "Publicフォルダー",
|
||||
|
||||
"dashboard.media.mediaHeaderTop.searchbox.placeholder": "フォルダー内を検索",
|
||||
|
||||
"dashboard.media.mediaSnippetForm.formDialog.title": "メディアを挿入: {0}",
|
||||
"dashboard.media.mediaSnippetForm.formDialog.description": "メディアファイル\"{0}\"を現在の記事に挿入する",
|
||||
|
||||
"dashboard.preview.input.placeholder": "URLを入力",
|
||||
"dashboard.preview.button.navigate.title": "ナビゲーション",
|
||||
"dashboard.preview.button.refresh.title": "更新",
|
||||
"dashboard.preview.button.open.title": "開く",
|
||||
|
||||
"dashboard.snippetsView.item.type.content": "コンテンツ用スニペット",
|
||||
"dashboard.snippetsView.item.type.media": "メディア用スニペット",
|
||||
"dashboard.snippetsView.item.quickAction.editSnippet": "スニペットを編集",
|
||||
"dashboard.snippetsView.item.quickAction.deleteSnippet": "スニペットを削除",
|
||||
"dashboard.snippetsView.item.quickAction.viewSnippet": "スニペットファイルの表示",
|
||||
@@ -161,6 +285,7 @@
|
||||
"dashboard.snippetsView.item.edit.formDialog.description": "\"{0}\"スニペットの編集",
|
||||
"dashboard.snippetsView.item.alert.title": "\"{0}\"スニペットを削除",
|
||||
"dashboard.snippetsView.item.alert.description": "本当に\"{0}\"スニペットを削除しますか?",
|
||||
|
||||
"dashboard.snippetsView.newForm.snippetInput.title.placeholder": "スニペットのタイトル",
|
||||
"dashboard.snippetsView.newForm.snippetInput.description.label": "概要",
|
||||
"dashboard.snippetsView.newForm.snippetInput.description.placeholder": "スニペットの概要",
|
||||
@@ -171,12 +296,14 @@
|
||||
"dashboard.snippetsView.newForm.snippetInput.isMediaSnippet.checkbox.description": "このスニペットをメディアファイル挿入時に利用",
|
||||
"dashboard.snippetsView.newForm.snippetInput.docsButton.title": "メディア用スニペットのプレースホルダーについて読む",
|
||||
"dashboard.snippetsView.newForm.snippetInput.docsButton.description": "スニペットに設定可能なプレースホルダーをドキュメントで確認",
|
||||
|
||||
"dashboard.snippetsView.snippets.ariaLabel": "スニペット ヘッダー",
|
||||
"dashboard.snippetsView.snippets.button.create": "新規スニペットを作成",
|
||||
"dashboard.snippetsView.snippets.select.description": "挿入するスニペットを選択してください。",
|
||||
"dashboard.snippetsView.snippets.empty.message": "スニペットはありません",
|
||||
"dashboard.snippetsView.snippets.readMore": "スニペットの使い方を読む",
|
||||
"dashboard.snippetsView.snippets.formDialog.title": "新規スニペットを作成",
|
||||
|
||||
"dashboard.steps.stepsToGetStarted.button.addFolder.title": "Front Matterに記事フォルダーとして登録",
|
||||
"dashboard.steps.stepsToGetStarted.initializeProject.name": "プロジェクトの初期設定",
|
||||
"dashboard.steps.stepsToGetStarted.initializeProject.description": "Front Matter CMSに必要な設定ファイルを作成します。クリックして開始してください。",
|
||||
@@ -184,20 +311,35 @@
|
||||
"dashboard.steps.stepsToGetStarted.framework.description": "静的サイトジェネレーターまたはフレームワークを選択して、必要なセッティングを追加します。",
|
||||
"dashboard.steps.stepsToGetStarted.framework.select": "フレームワークを選択",
|
||||
"dashboard.steps.stepsToGetStarted.framework.select.other": "その他",
|
||||
"dashboard.steps.stepsToGetStarted.assetsFolder.name": "アセットフォルダーを登録",
|
||||
"dashboard.steps.stepsToGetStarted.assetsFolder.description": "記事のメディアファイルを保存するためのフォルダーを選択してください。",
|
||||
"dashboard.steps.stepsToGetStarted.assetsFolder.public.title": "'public'フォルダーを使用する",
|
||||
"dashboard.steps.stepsToGetStarted.assetsFolder.assets.title": "Astroアセットフォルダー(src/assets)を使用する",
|
||||
"dashboard.steps.stepsToGetStarted.assetsFolder.other.description": "別のフォルダーを指定する場合は、frontmatter.jsonファイルへ手動で設定可能です。",
|
||||
"dashboard.steps.stepsToGetStarted.contentFolders.name": "記事ファイルのフォルダーを登録",
|
||||
"dashboard.steps.stepsToGetStarted.contentFolders.description": "記事ファイルの保存フォルダーを追加してください。フォルダーが設定されると、フォルダー内の記事ファイルがFront Matterでリスト化され、新規記事ファイルを追加できるようになります。",
|
||||
"dashboard.steps.stepsToGetStarted.contentFolders.description": "記事ファイルの保存フォルダーを追加してください。フォルダーが設定されると、フォルダー内の記事ファイルがFront Matterでリスト化され、新規の記事ファイルを追加できるようになります。",
|
||||
"dashboard.steps.stepsToGetStarted.contentFolders.label": "記事ファイルを含むフォルダー",
|
||||
"dashboard.steps.stepsToGetStarted.contentFolders.information.description": "フォルダーの登録は、エクスプローラーでフォルダー名を右クリックして「フォルダーを登録」を選択することでも可能です。",
|
||||
"dashboard.steps.stepsToGetStarted.contentFolders.information.description": "エクスプローラーでフォルダー名を右クリックして「フォルダーを登録」を選択する方法でも、フォルダーの登録が可能です。",
|
||||
"dashboard.steps.stepsToGetStarted.tags.name": "全てのタグとカテゴリーをインポート(オプション)",
|
||||
"dashboard.steps.stepsToGetStarted.tags.description": "Front Matterに記事用フォルダーが登録されました。記事から全てのタグとカテゴリーをインポートしますか?",
|
||||
"dashboard.steps.stepsToGetStarted.git.name": "Git同期を有効化しますか?",
|
||||
"dashboard.steps.stepsToGetStarted.git.description": "Git同期を有効にして、変更内容をリポジトリと簡単に同期させます。",
|
||||
"dashboard.steps.stepsToGetStarted.showDashboard.name": "ダッシュボードを開く",
|
||||
"dashboard.steps.stepsToGetStarted.showDashboard.description": "全ての設定が終わると、ダッシュボードが表示できるようになります。",
|
||||
"dashboard.steps.stepsToGetStarted.template.name": "設定用のテンプレートを使用する",
|
||||
"dashboard.steps.stepsToGetStarted.template.description": "おすすめの設定のテンプレートを選択して、frontmatter.jsonに反映させます。",
|
||||
"dashboard.steps.stepsToGetStarted.template.warning": "選択によりプロジェクトの構成にテンプレートが適用され、この設定画面は終了します。",
|
||||
"dashboard.steps.stepsToGetStarted.astroContentTypes.name": "Astroコンテンツコレクションのコンテンツタイプを作成する",
|
||||
|
||||
"dashboard.taxonomyView.button.add.title": "\"{0}\"をタクソノミーに追加",
|
||||
"dashboard.taxonomyView.button.tag.title": "タグを追加",
|
||||
"dashboard.taxonomyView.button.edit.title": "\"{0}\"を編集",
|
||||
"dashboard.taxonomyView.button.merge.title": "\"{0}\"をマージ",
|
||||
"dashboard.taxonomyView.button.move.title": "他のタクソノミーへ移行",
|
||||
"dashboard.taxonomyView.button.delete.title": "\"{0}\"を削除",
|
||||
|
||||
"dashboard.taxonomyView.taxonomyLookup.button.title": "{1}\"{0}\"の記事一覧を表示",
|
||||
|
||||
"dashboard.taxonomyView.taxonomyManager.description": "サイト内{0}の新規作成・編集・コマンド",
|
||||
"dashboard.taxonomyView.taxonomyManager.button.create": "新規{0}を作成",
|
||||
"dashboard.taxonomyView.taxonomyManager.table.heading.name": "名前",
|
||||
@@ -205,17 +347,25 @@
|
||||
"dashboard.taxonomyView.taxonomyManager.table.heading.action": "コマンド",
|
||||
"dashboard.taxonomyView.taxonomyManager.table.row.empty": "{0}はありません",
|
||||
"dashboard.taxonomyView.taxonomyManager.table.unmapped.title": "設定ファイルに見つかりません",
|
||||
"dashboard.taxonomyView.taxonomyManager.filterInput.placeholder": "絞り込み",
|
||||
|
||||
"dashboard.taxonomyView.taxonomyTagging.pageTitle": "タクソノミー {0} をリマッピング",
|
||||
"dashboard.taxonomyView.taxonomyTagging.checkbox": "ページにタクソノミー{0}を付ける",
|
||||
|
||||
"dashboard.taxonomyView.taxonomyView.navigationBar.title": "タクソノミーを選択",
|
||||
"dashboard.taxonomyView.taxonomyView.button.import": "タクソノミーをインポート",
|
||||
"dashboard.taxonomyView.taxonomyView.navigationItem.tags": "タグ",
|
||||
"dashboard.taxonomyView.taxonomyView.navigationItem.categories": "カテゴリー",
|
||||
|
||||
"dashboard.unkownView.title": "表示出来る画面がありません",
|
||||
"dashboard.unkownView.description": "存在しない画面で終了してしまったようです。ダッシュボードを再度開きなおしてください。",
|
||||
|
||||
"dashboard.welcomeScreen.title": "Front Matterで静的サイトを管理しよう",
|
||||
"dashboard.welcomeScreen.thanks": "Front Matterをお使いいただきありがとうございます!",
|
||||
"dashboard.welcomeScreen.description": "私たちはFront Matterをより使いやすくするため、日々努力しています。ご質問やご提案など、GitHubまでお気軽にお問い合わせください。",
|
||||
"dashboard.welcomeScreen.link.github.title": "GitHub",
|
||||
"dashboard.welcomeScreen.link.github.label": "GitHub / ドキュメント",
|
||||
"dashboard.welcomeScreen.link.github.label": "GitHub",
|
||||
"dashboard.welcomeScreen.link.documentation.label": "ドキュメント",
|
||||
"dashboard.welcomeScreen.link.sponsor.title": "スポンサーになる",
|
||||
"dashboard.welcomeScreen.link.sponsor.label": "スポンサー",
|
||||
"dashboard.welcomeScreen.link.review.title": "評価する",
|
||||
@@ -223,41 +373,71 @@
|
||||
"dashboard.welcomeScreen.actions.heading": "以下の手順に従って、この拡張機能をスタートさせてください。",
|
||||
"dashboard.welcomeScreen.actions.description": "サイドパネルからもFront Matterを利用できます。サイドパネルでは、各コンテンツに合った具体的なコマンドが実行可能です。",
|
||||
"dashboard.welcomeScreen.actions.thanks": "Front Matterをお楽しみください!",
|
||||
|
||||
"dashboard.media.detailsSlideOver.unmapped.description": "未割り当てのファイルのメタデータを再マップしますか?",
|
||||
|
||||
"dashboard.configuration.astro.astroContentTypes.empty": "Astroコンテンツコレクションが見つかりません。",
|
||||
"dashboard.configuration.astro.astroContentTypes.description": "以下のAstroコンテンツコレクションは、コンテンツタイプを生成するために使用できます。",
|
||||
|
||||
"panel.git.gitAction.title": "変更の反映",
|
||||
"panel.git.gitAction.branch.select": "ブランチを選択",
|
||||
"panel.git.gitAction.input.placeholder": "コミットメッセージ",
|
||||
"panel.git.gitAction.button.fetch": "フェッチ",
|
||||
|
||||
"panel.contentType.contentTypeValidator.title": "記事タイプ",
|
||||
"panel.contentType.contentTypeValidator.hint": "記事タイプのフィールドは設定と異なります。この記事の記事タイプを、作成・更新または設定しますか?",
|
||||
"panel.contentType.contentTypeValidator.button.create": "新しい記事タイプを作成",
|
||||
"panel.contentType.contentTypeValidator.button.add": "この記事タイプの設定にないフィールドを追加",
|
||||
"panel.contentType.contentTypeValidator.button.change": "このファイルの記事タイプを変更",
|
||||
|
||||
"panel.dataBlock.dataBlockField.group.selected.edit": "編集: {0}",
|
||||
"panel.dataBlock.dataBlockField.group.selected.create": "新規{0}を作成",
|
||||
"panel.dataBlock.dataBlockField.group.select": "グループを選択",
|
||||
"panel.dataBlock.dataBlockField.add": "{0}を追加",
|
||||
|
||||
"panel.dataBlock.dataBlockRecord.edit": "レコードを編集",
|
||||
"panel.dataBlock.dataBlockRecord.delete": "レコードを削除",
|
||||
|
||||
"panel.dataBlock.dataBlockRecords.label": "レコード",
|
||||
|
||||
"panel.dataBlock.dataBlockSelector.label": "ブロックタイプ",
|
||||
|
||||
"panel.errorBoundary.fieldBoundary.label": "フィールドの表示に失敗しました",
|
||||
|
||||
"panel.fields.choiceField.select": "{0}を選択",
|
||||
"panel.fields.choiceField.clear": "値をクリア",
|
||||
|
||||
"panel.fields.contentTypeRelationshipField.loading": "読み込み中...",
|
||||
|
||||
"panel.fields.dateTimeField.button.pick": "日付を選択",
|
||||
"panel.fields.dateTimeField.time": "時刻",
|
||||
|
||||
"panel.fields.fieldMessage.required": "{0}は必須フィールドです",
|
||||
|
||||
"panel.fields.fileField.delete": "ファイルを削除",
|
||||
"panel.fields.fileField.add": "{0}を追加",
|
||||
|
||||
"panel.fields.imageFallback.label": "画像を読み込めませんでした。",
|
||||
|
||||
"panel.fields.listField.edit": "レコードを編集",
|
||||
"panel.fields.listField.delete": "レコードを削除",
|
||||
|
||||
"panel.fields.previewImage.remove": "画像を削除",
|
||||
|
||||
"panel.fields.previewImageField.add": "{0}を追加",
|
||||
|
||||
"panel.fields.slugField.update": "更新が可能",
|
||||
"panel.fields.slugField.generate": "スラッグを生成",
|
||||
|
||||
"panel.fields.textField.ai.message": "Front Matter AIに{0}を提案してもらう",
|
||||
"panel.fields.textField.ai.generate": "提案を生成中...",
|
||||
"panel.fields.textField.loading": "読み込み中",
|
||||
"panel.fields.textField.limit": "値が上限を超えています。{0}",
|
||||
|
||||
"panel.fields.wrapperField.unknown": "不明なフィールド: {0}",
|
||||
|
||||
"panel.actions.title": "コマンド",
|
||||
|
||||
"panel.articleDetails.title": "詳細",
|
||||
"panel.articleDetails.type": "項目",
|
||||
"panel.articleDetails.total": "数",
|
||||
@@ -266,15 +446,18 @@
|
||||
"panel.articleDetails.internalLinks": "内部リンク",
|
||||
"panel.articleDetails.externalLinks": "外部リンク",
|
||||
"panel.articleDetails.images": "画像",
|
||||
|
||||
"panel.baseView.initialize": "プロジェクトの初期設定",
|
||||
"panel.baseView.actions.title": "コマンド",
|
||||
"panel.baseView.action.openDashboard": "ダッシュボードを開く",
|
||||
"panel.baseView.action.openPreview": "プレビューを開く",
|
||||
"panel.baseView.action.createContent": "新しい記事を作成",
|
||||
"panel.baseView.empty": "他の操作を見るには、ファイルを開いてください。",
|
||||
|
||||
"panel.fileList.label.singular": "ファイル",
|
||||
"panel.fileList.label.plural": "ファイル",
|
||||
|
||||
"panel.folderAndFiles.title": "最近の更新",
|
||||
|
||||
"panel.globalSettings.title": "一般設定",
|
||||
"panel.globalSettings.action.modifiedDate.label": "最終更新日",
|
||||
"panel.globalSettings.action.modifiedDate.description": "最終更新日を自動で更新",
|
||||
@@ -284,7 +467,10 @@
|
||||
"panel.globalSettings.action.preview.placeholder": "例: {0}",
|
||||
"panel.globalSettings.action.server.label": "ローカルサーバーのコマンド",
|
||||
"panel.globalSettings.action.server.placeholder": "例: {0}",
|
||||
|
||||
"panel.metadata.title": "メタデータ",
|
||||
"panel.metadata.focusProblems": "詳細を「問題」表示で確認してください。",
|
||||
|
||||
"panel.otherActions.title": "他のコマンド",
|
||||
"panel.otherActions.writingSettings.enabled": "ライティング設定が有効",
|
||||
"panel.otherActions.writingSettings.disabled": "ライティング設定を有効化",
|
||||
@@ -295,17 +481,23 @@
|
||||
"panel.otherActions.documentation": "ドキュメントを開く",
|
||||
"panel.otherActions.settings": "設定方法の概要",
|
||||
"panel.otherActions.issue": "問題を報告",
|
||||
|
||||
"panel.preview.title": "プレビューを表示",
|
||||
|
||||
"panel.publishAction.publish": "公開",
|
||||
"panel.publishAction.unpublish": "下書きに戻す",
|
||||
|
||||
"panel.seoDetails.recommended": "推奨",
|
||||
|
||||
"panel.seoKeywordInfo.density": "キーワード出現率 {0} *",
|
||||
"panel.seoKeywordInfo.validInfo.label": "見出しへの利用",
|
||||
"panel.seoKeywordInfo.validInfo.content": "本文",
|
||||
|
||||
"panel.seoKeywords.title": "キーワード",
|
||||
"panel.seoKeywords.header.keyword": "キーワード",
|
||||
"panel.seoKeywords.header.details": "詳細",
|
||||
"panel.seoKeywords.density": "* キーワード出現率は通常1~1.5%で十分です。",
|
||||
|
||||
"panel.seoStatus.title": "推奨項目",
|
||||
"panel.seoStatus.header.property": "項目",
|
||||
"panel.seoStatus.header.length": "長さ",
|
||||
@@ -315,50 +507,288 @@
|
||||
"panel.seoStatus.seoFieldInfo.article": "記事の長さ",
|
||||
"panel.seoStatus.collapsible.title": "SEO対策",
|
||||
"panel.seoStatus.required": "{0}か{1}は必須です。",
|
||||
|
||||
"panel.slugAction.title": "スラッグを最適化",
|
||||
|
||||
"panel.spinner.loading": "読み込み中...",
|
||||
|
||||
"panel.startServerbutton.start": "サーバーを起動",
|
||||
"panel.startServerbutton.stop": "サーバーを停止",
|
||||
|
||||
"panel.tag.add": "\"{0}\"を設定に追加",
|
||||
|
||||
"panel.tagPicker.inputPlaceholder.empty": "{0}を選択",
|
||||
"panel.tagPicker.inputPlaceholder.disabled": "{0}の上限数に達しました",
|
||||
"panel.tagPicker.ai.suggest": "Front Matter AIに{0}を提案してもらう",
|
||||
"panel.tagPicker.ai.generating": "提案を生成中...",
|
||||
"panel.tagPicker.limit": "上限数: {0}",
|
||||
"panel.tagPicker.unkown": "不明なタグを追加",
|
||||
|
||||
"panel.tags.tag.warning": "\"{0}\"は設定に保存されていません。削除すると復元できませんのでご注意ください。",
|
||||
|
||||
"panel.viewPanel.mediaInsert": "ダッシュボードのメディア管理画面から、利用したい画像を選択してください。",
|
||||
"dashboard.steps.stepsToGetStarted.assetsFolder.name": "アセットフォルダーの場所はどこですか?",
|
||||
"dashboard.steps.stepsToGetStarted.assetsFolder.description": "記事のメディアファイルを保存するためのフォルダーを選択してください。",
|
||||
"dashboard.steps.stepsToGetStarted.assetsFolder.public.title": "'public'フォルダーを使用する",
|
||||
"dashboard.steps.stepsToGetStarted.assetsFolder.assets.title": "Astroアセットフォルダー(src/assets)を使用する",
|
||||
"dashboard.steps.stepsToGetStarted.assetsFolder.other.description": "別のフォルダを設定する場合は、frontmatter.jsonファイルで手動で行うことができます。",
|
||||
"dashboard.steps.stepsToGetStarted.template.name": "設定テンプレートを使用する",
|
||||
"dashboard.steps.stepsToGetStarted.template.description": "おすすめの設定でfrontmatter.jsonファイルを事前に埋めるテンプレートを選択します。",
|
||||
|
||||
"commands.article.setDate.error": "日付の表示形式の解析中に何らかの問題が発生しました。\"{0}\"の設定を確認してください。",
|
||||
"commands.article.updateSlug.error": "ファイル名を変更できませんでした。: {0}",
|
||||
"commands.article.rename.fileNotExists.error": "ファイルが存在しません。",
|
||||
"commands.article.rename.fileExists.error": "\"{0}\" というファイル名は既に存在しています。",
|
||||
"commands.article.rename.fileName.title": "ファイル名を変更: {0}",
|
||||
"commands.article.rename.fileName.prompt": "ファイル名",
|
||||
|
||||
"commands.cache.cleared": "キャッシュがクリアされました。",
|
||||
|
||||
"commands.chatbot.title": "何でも聞いてください",
|
||||
|
||||
"commands.content.option.contentType.label": "記事タイプから記事を作成",
|
||||
"commands.content.option.contentType.description": "設定済みの記事タイプを選択して記事を作成",
|
||||
"commands.content.option.template.label": "テンプレートから記事を作成",
|
||||
"commands.content.option.template.description": "設定済みのテンプレートを選択して記事を作成",
|
||||
"commands.content.quickPick.title": "記事の作成",
|
||||
"commands.content.quickPick.placeholder": "記事の作成方法を選択してください。",
|
||||
|
||||
"commands.dashboard.title": "ダッシュボード",
|
||||
|
||||
"commands.folders.addMediaFolder.inputBox.title": "メディアフォルダーの追加",
|
||||
"commands.folders.addMediaFolder.inputBox.prompt": "新規作成するフォルダー名を入力してください。(\"/\"で多階層のフォルダーを作成可能です)",
|
||||
"commands.folders.addMediaFolder.noFolder.warning": "フォルダー名が入力されていません。",
|
||||
"commands.folders.create.folderExists.warning": "フォルダーは既に登録済です。",
|
||||
"commands.folders.create.input.title": "フォルダーを登録する",
|
||||
"commands.folders.create.input.prompt": "登録するフォルダー名を指定してください。",
|
||||
"commands.folders.create.input.placeholder": "フォルダー名",
|
||||
"commands.folders.create.success": "フォルダーが登録されました。",
|
||||
"commands.folders.getWorkspaceFolder.workspaceFolderPick.placeholder": "Front Matterを利用するメインのワークスペースのフォルダーを選択してください。",
|
||||
"commands.folders.get.notificationError.title": "\"{0}\"フォルダーが存在しません。このフォルダーを設定から削除してください。",
|
||||
"commands.folders.get.notificationError.remove.action": "フォルダー設定を削除",
|
||||
"commands.folders.get.notificationError.create.action": "フォルダーを作成",
|
||||
|
||||
"commands.i18n.create.warning.noFileSelected": "ファイルが選択されていません。",
|
||||
"commands.i18n.create.warning.noFile": "ファイルが取得できませんでした。",
|
||||
"commands.i18n.create.warning.noContentType": "現在のファイルの記事タイプを取得できませんでした。",
|
||||
"commands.i18n.create.warning.noConfig": "i18nの設定が見つかりません。",
|
||||
"commands.i18n.create.error.noLocaleDefinition": "現在のファイルのロケールを取得できませんでした。",
|
||||
"commands.i18n.create.error.noLocales": "現在のファイルは利用可能なすべての言語に翻訳されています。",
|
||||
"commands.i18n.create.error.noContentFolder": "現在のファイルの記事フォルダーを指定できませんでした。",
|
||||
"commands.i18n.create.error.fileExists": "そのi18n翻訳は既に存在しています。",
|
||||
"commands.i18n.create.success.created": "\"{0}\" i18n記事ファイルを作成しました。",
|
||||
"commands.i18n.create.quickPick.title": "言語別の記事を作成",
|
||||
"commands.i18n.create.quickPick.placeHolder": "どの言語で記事を作成しますか?",
|
||||
"commands.i18n.translate.progress.title": "記事を翻訳しています...",
|
||||
|
||||
"commands.preview.panel.title": "プレビュー: {0}",
|
||||
"commands.preview.askUserToPickFolder.title": "プレビュー用の記事フォルダーを選択してください。",
|
||||
|
||||
"commands.project.initialize.success": "プロジェクトが初期化されました。",
|
||||
"commands.project.switchProject.title": "どのプロジェクトに切り替えますか?",
|
||||
"commands.project.createSampleTemplate.info": "テンプレートサンプルを作成しました。",
|
||||
|
||||
"commands.settings.create.input.prompt": "設定に追加したい{0}の値を入力してください。",
|
||||
"commands.settings.create.input.placeholder": "{0}の名前",
|
||||
"commands.settings.create.warning": "入力された {0} は既に存在しています。",
|
||||
"commands.settings.create.quickPick.placeholder": "新規{0}をページに追加しますか?",
|
||||
"commands.settings.export.progress.title": "{0}: タグとカテゴリーをエクスポートしています。",
|
||||
"commands.settings.export.progress.success": "エクスポートが完了しました。タグ: {0} - カテゴリー: {1}",
|
||||
"commands.settings.remap.quickpick.title": "再構成",
|
||||
"commands.settings.remap.quickpick.placeholder": "何を再構成しますか?",
|
||||
"commands.settings.remap.noTaxonomy.warning": "編集可能な{0}が存在しません。",
|
||||
"commands.settings.remap.selectTaxonomy.placeholder": "編集したい{0}を選択してください。",
|
||||
"commands.settings.remap.newOption.input.prompt": "\"{1}\"を再構成します。変更したい{0}値を入力してください。全ての記事から{0}を削除する場合は空欄にしてください。",
|
||||
"commands.settings.remap.newOption.input.placeholder": "{0}名",
|
||||
"commands.settings.remap.delete.placeholder": "{1} {0}を削除しますか?",
|
||||
|
||||
"commands.statusListener.verifyRequiredFields.diagnostic.emptyField": "フィールド {0} は必須です。値を入力してください。",
|
||||
"commands.statusListener.verifyRequiredFields.notification.error": "以下の必須のフィールドに値が入力されていません。: {0}",
|
||||
|
||||
"commands.template.generate.input.title": "テンプレート名",
|
||||
"commands.template.generate.input.prompt": "テンプレート名を入力してください。",
|
||||
"commands.template.generate.input.placeholder": "article",
|
||||
"commands.template.generate.noTitle.warning": "テンプレート名が入力されていません。",
|
||||
"commands.template.generate.keepContents.title": "記事本文の反映",
|
||||
"commands.template.generate.keepContents.placeholder": "記事本文をテンプレートにそのまま残しますか?",
|
||||
"commands.template.generate.keepContents.noOption.warning": "記事本文を残すかどうかの選択がされませんでした。",
|
||||
"commands.template.generate.keepContents.success": "{0}フォルダー内にテンプレートが作成されました。",
|
||||
"commands.template.getTemplates.warning": "テンプレートがありません。",
|
||||
"commands.template.create.folderPath.warning": "取得されたプロジェクトフォルダーのパスが不正です。",
|
||||
"commands.template.create.noTemplates.warning": "テンプレートがありません。",
|
||||
"commands.template.create.selectTemplate.title": "テンプレートの選択",
|
||||
"commands.template.create.selectTemplate.placeholder": "記事テンプレートを選択してください。",
|
||||
"commands.template.create.selectTemplate.noTemplate.warning": "テンプレートが選択されていません。",
|
||||
"commands.template.create.selectTemplate.notFound.warning": "記事テンプレートが見つかりません。",
|
||||
"commands.template.create.success": "新規記事が有効になりました。",
|
||||
|
||||
"commands.wysiwyg.command.unorderedList.label": "順序なしリスト",
|
||||
"commands.wysiwyg.command.unorderedList.detail": "順序なしリストを追加",
|
||||
"commands.wysiwyg.command.orderedList.label": "順序付きリスト",
|
||||
"commands.wysiwyg.command.orderedList.detail": "順序付きリストを追加",
|
||||
"commands.wysiwyg.command.taskList.label": "タスクリスト",
|
||||
"commands.wysiwyg.command.taskList.detail": "タスクリストを追加",
|
||||
"commands.wysiwyg.command.code.label": "コード",
|
||||
"commands.wysiwyg.command.code.detail": "インラインコードスニペットを追加",
|
||||
"commands.wysiwyg.command.codeblock.label": "コードブロック",
|
||||
"commands.wysiwyg.command.codeblock.detail": "コードブロックを追加",
|
||||
"commands.wysiwyg.command.blockquote.label": "ブロック引用要素",
|
||||
"commands.wysiwyg.command.blockquote.detail": "ブロック引用要素を追加",
|
||||
"commands.wysiwyg.command.strikethrough.label": "取り消し線",
|
||||
"commands.wysiwyg.command.strikethrough.detail": "取り消し線付きテキストを追加",
|
||||
"commands.wysiwyg.quickPick.title": "WYSIWYG オプション",
|
||||
"commands.wysiwyg.quickPick.placeholder": "どのマークアップ要素を挿入しますか?",
|
||||
"commands.wysiwyg.addHyperlink.hyperlinkInput.title": "WYSIWYG ハイパーリンク",
|
||||
"commands.wysiwyg.addHyperlink.hyperlinkInput.prompt": "URLを入力",
|
||||
"commands.wysiwyg.addHyperlink.textInput.title": "WYSIWYG テキスト",
|
||||
"commands.wysiwyg.addHyperlink.textInput.prompt": "ハイパーリンクのテキストを入力",
|
||||
"commands.wysiwyg.insertText.heading.input.title": "見出し",
|
||||
"commands.wysiwyg.insertText.heading.input.placeholder": "見出しのレベルを選択",
|
||||
|
||||
"helpers.articleHelper.createContent.pageBundle.error": "{0}という名称のページバンドルは、既に {1} に存在しています。",
|
||||
"helpers.articleHelper.createContent.contentExists.warning": "同タイトルの記事が存在します。別のタイトルを付けてください。",
|
||||
"helpers.articleHelper.processCustomPlaceholders.placeholder.error": "プレースホルダー{0}の生成中にエラーが発生しました。",
|
||||
"helpers.articleHelper.parseFile.diagnostic.error": "{0}のfront matterの解析中にエラーが発生しました。",
|
||||
|
||||
"helpers.contentType.generate.noFrontMatter.error": "記事タイプの生成に必要なfront matterデータがありません。",
|
||||
"helpers.contentType.generate.override.quickPick.title": "デフォルトの記事タイプを上書き",
|
||||
"helpers.contentType.generate.override.quickPick.placeholder": "この記事のフィールド設定を、デフォルトの記事タイプのフィールド設定に上書きしますか?",
|
||||
"helpers.contentType.generate.contentTypeInput.title": "記事タイプを生成",
|
||||
"helpers.contentType.generate.contentTypeInput.prompt": "新規作成したい記事タイプ名を入力してください。",
|
||||
"helpers.contentType.generate.contentTypeInput.validation.enterName": "記事タイプ名を入力してください。",
|
||||
"helpers.contentType.generate.contentTypeInput.validation.nameExists": "この記事タイプ名は既に存在しています。",
|
||||
"helpers.contentType.generate.noContentTypeName.warning": "記事タイプが選択されませんでした。",
|
||||
"helpers.contentType.generate.pageBundle.quickPick.title": "ページバンドルとして使用",
|
||||
"helpers.contentType.generate.pageBundle.quickPick.placeHolder": "この記事タイプをページバンドルとして使用しますか?",
|
||||
"helpers.contentType.generate.updated.success": "記事タイプ {0} を更新しました。",
|
||||
"helpers.contentType.generate.generated.success": "記事タイプ {0} を生成しました。",
|
||||
"helpers.contentType.addMissingFields.noFrontMatter.warning": "追加すべきfront matterデータはありません。",
|
||||
"helpers.contentType.addMissingFields.updated.success": "記事タイプ {0} を更新しました。",
|
||||
"helpers.contentType.setContentType.noFrontMatter.warning": "記事タイプの設定が必要なfront matterデータが見つかりません。",
|
||||
"helpers.contentType.setContentType.quickPick.title": "記事タイプを選択",
|
||||
"helpers.contentType.setContentType.quickPick.placeholder": "どの記事タイプを使用しますか?",
|
||||
"helpers.contentType.create.allowSubContent.title": "サブコンテンツとしての要否",
|
||||
"helpers.contentType.create.allowSubContent.placeHolder": "新規記事をサブコンテンツとして作成しますか?",
|
||||
"helpers.contentType.create.allowSubContent.showOpenDialog.openLabel": "フォルダーを選択",
|
||||
"helpers.contentType.create.allowSubContent.showOpenDialog.title": "新規記事用のフォルダーを選択してください。",
|
||||
"helpers.contentType.create.pageBundle.title": "ページバンドルとして要否",
|
||||
"helpers.contentType.create.pageBundle.placeHolder": "ページバンドルとして記事を作成しますか?",
|
||||
"helpers.contentType.create.progress.title": "{0}: 記事ファイルを作成中...",
|
||||
"helpers.contentType.create.success": "記事ファイルを作成しました。",
|
||||
"helpers.contentType.verify.warning": "記事タイプ・コマンドは、このモードでは有効になっていません。",
|
||||
|
||||
"helpers.customScript.executing": "実行中: {0}",
|
||||
"helpers.customScript.singleRun.article.warning": "{0}: Article couldn't be retrieved.",
|
||||
"helpers.customScript.bulkRun.noFiles.warning": "{0}: ファイルが見つかりません。",
|
||||
"helpers.customScript.runMediaScript.noFolder.warning": "{0}: フォルダーまたはメディアへのパスの指定がされていません。",
|
||||
"helpers.customScript.showOutput.frontMatter.success": "{0}: front matter updated.",
|
||||
"helpers.customScript.showOutput.copyOutput.action": "出力結果をコピー",
|
||||
"helpers.customScript.showOutput.success": "{0}: カスタムスクリプトを実行しました。",
|
||||
"helpers.customScript.validateCommand.error": "不正なコマンド: {0}",
|
||||
|
||||
"helpers.dataFileHelper.process.error": "データファイルの実行中に何らかの問題が発生しました。",
|
||||
|
||||
"helpers.extension.getVersion.changelog": "変更履歴を確認する",
|
||||
"helpers.extension.getVersion.starIt": "⭐️を付ける",
|
||||
"helpers.extension.getVersion.update.notification": "{0} が v{1} に更新されました!新機能をチェックしてください!",
|
||||
"helpers.extension.migrateSettings.templates.quickPick.title": "{0} - テンプレート",
|
||||
"helpers.extension.migrateSettings.templates.quickPick.placeholder": "テンプレート機能の使用を継続しますか?",
|
||||
"helpers.extension.checkIfExtensionCanRun.warning": "Front MatterのBETA版は安定版がインストールされている場合は利用できません。BETA版のみがインストールされていることを確認してください。",
|
||||
|
||||
"helpers.mediaHelper.saveFile.folder.error": "選択されたフォルダーが見つかりません。",
|
||||
"helpers.mediaHelper.saveFile.file.uploaded.success": "ファイル{0}が{1}へアップロードされました。",
|
||||
"helpers.mediaHelper.saveFile.file.uploaded.failed": "申し訳ありません、{0}のアップロード中にエラーが発生しました。",
|
||||
"helpers.mediaHelper.deleteFile.file.deletion.failed": "申し訳ありません、{0}の削除中にエラーが発生しました。",
|
||||
|
||||
"helpers.mediaLibrary.remove.warning": "その場所にはファイル\"{0}\"が既に存在しています。",
|
||||
"helpers.mediaLibrary.remove.error": "申し訳ありません、\"{0}\"を\"{1}\"へのアップロード中にエラーが発生しました。",
|
||||
|
||||
"helpers.openFileInEditor.error": "ファイルを開けません。",
|
||||
|
||||
"helpers.questions.contentTitle.aiInput.title": "タイトルまたはディスクリプション",
|
||||
"helpers.questions.contentTitle.aiInput.prompt": "どんな内容について書きたいですか?",
|
||||
"helpers.questions.contentTitle.aiInput.placeholder": "どんな内容について書きたいですか?",
|
||||
"helpers.questions.contentTitle.aiInput.quickPick.title.separator": "タイトル/ディスクリプション",
|
||||
"helpers.questions.contentTitle.aiInput.quickPick.ai.separator": "AI生成によるタイトル",
|
||||
"helpers.questions.contentTitle.aiInput.select.title": "タイトルを選択",
|
||||
"helpers.questions.contentTitle.aiInput.select.placeholder": "記事に付けるタイトルを選択",
|
||||
"helpers.questions.contentTitle.aiInput.failed": "AIタイトルの取得に失敗しました。自分で作成するか、後からもう一度試してください。",
|
||||
"helpers.questions.contentTitle.aiInput.warning": "記事タイトルの入力がされていません。",
|
||||
"helpers.questions.contentTitle.titleInput.title": "記事タイトル",
|
||||
"helpers.questions.contentTitle.titleInput.prompt": "新しい記事のタイトルを入力してください。",
|
||||
"helpers.questions.contentTitle.titleInput.placeholder": "タイトル",
|
||||
"helpers.questions.contentTitle.titleInput.warning": "記事タイトルの入力がされていません。",
|
||||
"helpers.questions.selectContentFolder.quickPick.title": "フォルダーを選択",
|
||||
"helpers.questions.selectContentFolder.quickPick.placeholder": "記事の保存先を選択してください。",
|
||||
"helpers.questions.selectContentFolder.quickPick.noSelection.warning": "記事の保存先が選択されていません。",
|
||||
"helpers.questions.selectContentType.noContentType.warning": "記事タイプが見つかりません。先に記事タイプを作成してから記事を作成してください。",
|
||||
"helpers.questions.selectContentType.quickPick.title": "記事タイプ",
|
||||
"helpers.questions.selectContentType.quickPick.placeholder": "新規作成する記事の記事タイプを選択してください。",
|
||||
"helpers.questions.selectContentType.noSelection.warning": "記事タイプが選択されていません。",
|
||||
"helpers.questions.selectContentType.quickPick.error.noContentTypes": "このフォルダーには、一致する記事タイプが設定されていません。",
|
||||
|
||||
"helpers.seoHelper.checkLength.diagnostic.message": "記事{0}の文字数が{1}文字を超えています(現在の文字数: {2})。SEOの観点上、{1}文字以内に収めることが推奨されます。",
|
||||
|
||||
"helpers.settingsHelper.checkToPromote.message": "ローカル設定が存在します。この設定をグローバル設定(\"frontmatter.json\")に昇格させますか?",
|
||||
"helpers.settingsHelper.promote.success": "全ての設定をチームレベルに昇格しました。",
|
||||
"helpers.settingsHelper.readConfig.progress.title": "{0}: 動的な設定ファイルを読み込んでいます...",
|
||||
"helpers.settingsHelper.readConfig.error": "設定の読み込みでエラーが発生しました。",
|
||||
"helpers.settingsHelper.refreshConfig.success": "設定を再読み込みしました。",
|
||||
"helpers.settingsHelper.safeUpdate.warning": "Front Matter CMSの構成が拡張または分割されているため、\"{0}\"の設定を更新できませんでした。手動で更新を加えてください。更新情報についての出力を確認してください。",
|
||||
|
||||
"helpers.taxonomyHelper.rename.input.title": "タクソノミー名を変更 {0}",
|
||||
"helpers.taxonomyHelper.rename.validate.equalValue": "現在のファイル名とは別のファイル名を入力してください。",
|
||||
"helpers.taxonomyHelper.rename.validate.noValue": "新しいファイル名を入力してください。",
|
||||
"helpers.taxonomyHelper.merge.quickPick.title": "\"{0}\"を別の{1}にマージ",
|
||||
"helpers.taxonomyHelper.merge.quickPick.placeholder": "マージする{0}を選択してください。",
|
||||
"helpers.taxonomyHelper.delete.quickPick.title": "\"{0}\"を{1}から削除",
|
||||
"helpers.taxonomyHelper.delete.quickPick.placeholder": "本当に\"{0}\"を{1}から削除しますか?",
|
||||
"helpers.taxonomyHelper.createNew.input.title": "{0}に新規タクソノミーを作成",
|
||||
"helpers.taxonomyHelper.createNew.input.placeholder": "作成したいタクソノミー名を入力してください。",
|
||||
"helpers.taxonomyHelper.createNew.input.validate.noValue": "タクソノミー名は必須です。",
|
||||
"helpers.taxonomyHelper.createNew.input.validate.exists": "このタクソノミー名は既に存在しています。",
|
||||
"helpers.taxonomyHelper.process.insert": "{0}: 選択した記事に \"{1}\" を追加しています。",
|
||||
"helpers.taxonomyHelper.process.edit": "{0}: {2}内の\"{1}\"を{3}に変更しています。",
|
||||
"helpers.taxonomyHelper.process.merge": "{0}: {2}内の\"{1}\"を{3}にマージしています。",
|
||||
"helpers.taxonomyHelper.process.delete": "{0}: \"{1}\"を{2}から削除しています。",
|
||||
"helpers.taxonomyHelper.process.insert.success": "追加しました。",
|
||||
"helpers.taxonomyHelper.process.edit.success": "変更しました。",
|
||||
"helpers.taxonomyHelper.process.merge.success": "マージしました。",
|
||||
"helpers.taxonomyHelper.process.delete.success": "削除しました。",
|
||||
"helpers.taxonomyHelper.move.quickPick.title": "\"{0}\"を別のタクソノミータイプに移行",
|
||||
"helpers.taxonomyHelper.move.quickPick.placeholder": "移行先のタクソノミータイプを選択してください。",
|
||||
"helpers.taxonomyHelper.move.progress.title": "{0}: \"{1}\"を{2}から\"${3}\"へ移行しています。",
|
||||
"helpers.taxonomyHelper.move.success": "移行しました。",
|
||||
|
||||
"listeners.dashboard.dashboardListener.openConfig.notification": "設定内容を確認するには\"frontmatter.json\"を開いてください。",
|
||||
"listeners.dashboard.dashboardListener.pinItem.noPath.error": "パスが指定されていません。",
|
||||
"listeners.dashboard.dashboardListener.pinItem.coundNotPin.error": "ピン留めができませんでした。",
|
||||
"listeners.dashboard.dashboardListener.pinItem.coundNotUnPin.error": "ピン留めの解除ができませんでした。",
|
||||
|
||||
"listeners.dashboard.settingsListener.triggerTemplate.notification": "テンプレートファイルがコピーされました。",
|
||||
"common.openOnWebsite": "ウェブサイトで開く",
|
||||
"common.filter.value": "{0} でフィルタリング",
|
||||
"dashboard.media.detailsSlideOver.unmapped.description": "未割り当てのファイルのメタデータを再マップしますか",
|
||||
"common.settings": "設定",
|
||||
"common.refreshSettings": "設定の更新",
|
||||
"common.pin": "ピン",
|
||||
"common.unpin": "解除",
|
||||
"settings.view.common": "コモン",
|
||||
"settings.view.contentFolders": "コンテンツ フォルダー",
|
||||
"settings.view.astro": "アストロ",
|
||||
"settings.openOnStartup": "起動時にダッシュボードを開く",
|
||||
"settings.contentTypes": "コンテンツ タイプ",
|
||||
"settings.contentFolders": "コンテンツ フォルダー",
|
||||
"settings.diagnostic": "診断",
|
||||
"settings.diagnostic.description": "診断プログラムを実行して、フロントマター CMS 構成全体を確認できます。",
|
||||
"settings.diagnostic.link": "完全診断を実行する",
|
||||
"settings.commonSettings.website.title": "ウェブサイトとSSGの設定",
|
||||
"settings.commonSettings.previewUrl": "URL のプレビュー",
|
||||
"settings.commonSettings.websiteUrl": "ウェブサイトの URL",
|
||||
"settings.commonSettings.startCommand": "SSG/フレームワーク起動コマンド",
|
||||
"dashboard.contents.overview.pinned": "固定",
|
||||
"dashboard.steps.stepsToGetStarted.astroContentTypes.name": "Astroコンテンツコレクションのコンテンツタイプを作成する",
|
||||
"dashboard.welcomeScreen.link.documentation.label": "ドキュメンテーション",
|
||||
"dashboard.configuration.astro.astroContentTypes.empty": "Astroコンテンツコレクションが見つかりません。",
|
||||
"dashboard.configuration.astro.astroContentTypes.description": "以下のAstroコンテンツコレクションは、コンテンツタイプを生成するために使用できます。"
|
||||
"listeners.dashboard.settingsListener.triggerTemplate.progress.title": "テンプレートをダウンロードして初期化しています...",
|
||||
"listeners.dashboard.settingsListener.triggerTemplate.download.error": "テンプレートのダウンロードに失敗しました。",
|
||||
"listeners.dashboard.settingsListener.triggerTemplate.init.error": "テンプレートの初期化に失敗しました。",
|
||||
"listeners.dashboard.settingsListener.setSecretValue.message": "設定が更新されました。",
|
||||
|
||||
"listeners.dashboard.snippetListener.addSnippet.missingFields.warning": "スニペットのタイトルまたはbodyが空です。",
|
||||
"listeners.dashboard.snippetListener.addSnippet.exists.warning": "同じタイトルのスニペットが既に存在しています。",
|
||||
"listeners.dashboard.snippetListener.updateSnippet.noSnippets.warning": "更新が必要なスニペットはありません。",
|
||||
|
||||
"listeners.general.gitListener.push.error": "submoduleのpushに失敗しました。",
|
||||
|
||||
"listeners.panel.dataListener.aiSuggestTaxonomy.noEditor.error": "アクティブなエディターがありません。",
|
||||
"listeners.panel.dataListener.aiSuggestTaxonomy.noData.error": "記事データがありません。",
|
||||
"listeners.panel.dataListener.getDataFileEntries.noDataFiles.error": "データファイルのエントリーが見つかりませんでした。",
|
||||
"listeners.panel.dataListener.pushMetadata.frontMatter.error": "front matterの解析中にエラーが発生しまいsた。ファイルの内容を確認してください。",
|
||||
|
||||
|
||||
"listeners.panel.taxonomyListener.aiSuggestTaxonomy.noEditor.error": "アクティブなエディターがありません。",
|
||||
"listeners.panel.taxonomyListener.aiSuggestTaxonomy.noData.error": "記事データがありません。",
|
||||
|
||||
"services.modeSwitch.switchMode.quickPick.placeholder": "モードを選択してください。",
|
||||
"services.modeSwitch.switchMode.quickPick.title": "{0}: モードの選択",
|
||||
"services.modeSwitch.setText.mode": "モード: {0}",
|
||||
|
||||
"services.pagesParser.parsePages.statusBar.text": "読み込み中...",
|
||||
"services.pagesParser.parsePages.file.error": "ファイルエラー: {0}",
|
||||
|
||||
"services.sponsorAi.getTitles.warning": "AIによるタイトル生成に時間がかかりすぎています。後でもう一度試してください。",
|
||||
"services.sponsorAi.getDescription.warning": "AIによるディスクリプション生成に時間がかかりすぎています。後でもう一度試してください。",
|
||||
"services.sponsorAi.getTaxonomySuggestions.warning": "AIによるタクソノミー生成に時間がかかりすぎています。後でもう一度試してください。",
|
||||
|
||||
"services.terminal.openLocalServerTerminal.terminalOption.message": "ローカルサーバーを起動"
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
"common.edit": "Edit",
|
||||
"common.delete": "Delete",
|
||||
"common.cancel": "Cancel",
|
||||
"common.apply": "Apply",
|
||||
"common.clear": "Clear",
|
||||
"common.clear.value": "Clear value",
|
||||
"common.search": "Search",
|
||||
@@ -20,6 +21,7 @@
|
||||
"common.slug": "Slug",
|
||||
"common.support": "Support",
|
||||
"common.remove.value": "Remove {0}",
|
||||
"common.filter": "Back",
|
||||
"common.filter.value": "Filter by {0}",
|
||||
"common.error.message": "Sorry, something went wrong.",
|
||||
"common.openOnWebsite": "Open on website",
|
||||
@@ -32,6 +34,18 @@
|
||||
"common.yes": "yes",
|
||||
"common.no": "no",
|
||||
"common.openSettings": "Open settings",
|
||||
"common.back": "Back",
|
||||
"common.open": "Open",
|
||||
"common.openWithValue": "Open: {0}",
|
||||
"common.openCustomActions": "Open custom actions",
|
||||
"common.view": "View",
|
||||
"common.translate": "Translate",
|
||||
"common.languages": "Languages",
|
||||
"common.scripts": "Scripts",
|
||||
"common.rename": "Rename",
|
||||
"common.docs": "Documentation",
|
||||
|
||||
"loading.initPages": "Loading content",
|
||||
|
||||
"notifications.outputChannel.link": "output window",
|
||||
"notifications.outputChannel.description": "Check the {0} for more details.",
|
||||
@@ -39,18 +53,36 @@
|
||||
"settings.view.common": "Common",
|
||||
"settings.view.contentFolders": "Content folders",
|
||||
"settings.view.astro": "Astro",
|
||||
"settings.view.integration": "Integration",
|
||||
|
||||
"settings.openOnStartup": "Open dashboard on startup",
|
||||
"settings.contentTypes": "Content types",
|
||||
"settings.contentFolders": "Content folders",
|
||||
"settings.diagnostic": "Diagnostic",
|
||||
"settings.diagnostic.description": "You can run the diagnostics to check the whole Front Matter CMS configuration.",
|
||||
"settings.diagnostic.link": "Run full diagnostics",
|
||||
"settings.git": "Git synchronization",
|
||||
"settings.git.enabled": "Enable Git synchronization to easily sync your changes with your repository.",
|
||||
"settings.git.commitMessage": "Commit message",
|
||||
"settings.git.submoduleInfo": "When working with Git submodules, you can refer to the submodule settings in the documentation.",
|
||||
"settings.git.submoduleLink": "Read more about Git submodules",
|
||||
"settings.integration.title": "Integration",
|
||||
|
||||
"settings.commonSettings.website.title": "Website and SSG settings",
|
||||
"settings.commonSettings.previewUrl": "Preview URL",
|
||||
"settings.commonSettings.websiteUrl": "Website URL",
|
||||
"settings.commonSettings.startCommand": "SSG/Framework start command",
|
||||
|
||||
"settings.integrationsView.deepl.title": "DeepL",
|
||||
"settings.integrationsView.deepl.intput.label": "API key",
|
||||
"settings.integrationsView.deepl.intput.placeholder": "Enter your Deepl API key",
|
||||
|
||||
"settings.integrationsView.azure.title": "Azure AI Translator Service",
|
||||
"settings.integrationsView.azure.intput.label": "Subscription key",
|
||||
"settings.integrationsView.azure.intput.placeholder": "Enter your Azure AI Translator - Subscription key",
|
||||
"settings.integrationsView.azure.region.label": "Region",
|
||||
"settings.integrationsView.azure.region.placeholder": "Enter your Azure AI Translator - Region. Example: westeurope",
|
||||
|
||||
"developer.title": "Developer mode",
|
||||
"developer.reload.title": "Reload the dashboard",
|
||||
"developer.reload.label": "Reload",
|
||||
@@ -78,6 +110,8 @@
|
||||
"dashboard.contents.contentActions.menuItem.view": "View",
|
||||
"dashboard.contents.contentActions.alert.title": "Delete: {0}",
|
||||
"dashboard.contents.contentActions.alert.description": "Are you sure you want to delete the \"{0}\" content?",
|
||||
"dashboard.contents.contentActions.translations.create": "Create translation",
|
||||
"dashboard.contents.contentActions.translations.menu": "Translations",
|
||||
|
||||
"dashboard.contents.item.invalidTitle": "<invalid title>",
|
||||
"dashboard.contents.item.invalidDescription": "<invalid description>",
|
||||
@@ -105,6 +139,7 @@
|
||||
"dashboard.dataView.dataView.getStarted": "Select a data type to get started",
|
||||
"dashboard.dataView.dataView.noDataFiles": "No data files found",
|
||||
"dashboard.dataView.dataView.getStarted.link": "Read more to get started using data files",
|
||||
"dashboard.dataView.dataView.update.message": "Updated your data entries",
|
||||
|
||||
"dashboard.dataView.emptyView.heading": "Select your date type first",
|
||||
|
||||
@@ -115,6 +150,13 @@
|
||||
|
||||
"dashboard.errorView.description": "Please close the dashboard and try again.",
|
||||
|
||||
"dashboard.filters.languageFilter.label": "Locale",
|
||||
"dashboard.filters.languageFilter.all": "All",
|
||||
|
||||
"dashboard.header.actionsBar.itemsSelected": "{0} selected",
|
||||
"dashboard.header.actionsBar.alertDelete.title": "Delete selected files",
|
||||
"dashboard.header.actionsBar.alertDelete.description": "Are you sure you want to delete the selected files?",
|
||||
|
||||
"dashboard.header.breadcrumb.home": "Home",
|
||||
|
||||
"dashboard.header.clearFilters.title": "Clear filters, grouping, and sorting",
|
||||
@@ -168,7 +210,7 @@
|
||||
"dashboard.header.tabs.contents": "Contents",
|
||||
"dashboard.header.tabs.media": "Media",
|
||||
"dashboard.header.tabs.snippets": "Snippets",
|
||||
"dashboard.header.tabs.data": "data",
|
||||
"dashboard.header.tabs.data": "Data",
|
||||
"dashboard.header.tabs.taxonomies": "Taxonomies",
|
||||
|
||||
"dashboard.header.viewSwitch.toGrid": "Change to grid",
|
||||
@@ -198,10 +240,17 @@
|
||||
"dashboard.media.folderCreation.hexo.create": "Create post asset folder",
|
||||
"dashboard.media.folderCreation.folder.create": "Create new folder",
|
||||
|
||||
"dashboard.media.folderItem.contentDirectory": "Content directory",
|
||||
"dashboard.media.folderItem.publicDirectory": "Public directory",
|
||||
|
||||
"dashboard.media.item.buttom.insert.image": "Insert image",
|
||||
"dashboard.media.item.buttom.insert.snippet": "Insert snippet",
|
||||
|
||||
"dashboard.media.item.quickAction.insert.field": "Insert image for your \"{0}\" field",
|
||||
"dashboard.media.item.quickAction.insert.markdown": "Insert image with markdown markup",
|
||||
"dashboard.media.item.quickAction.copy.path": "Copy media path",
|
||||
"dashboard.media.item.quickAction.delete": "Delete media file",
|
||||
"dashboard.media.item.menuItem.view": "View media details",
|
||||
"dashboard.media.item.menuItem.edit.metadata": "Edit metadata",
|
||||
"dashboard.media.item.menuItem.insert.image": "Insert image",
|
||||
"dashboard.media.item.menuItem.reveal.media": "Reveal media",
|
||||
@@ -212,7 +261,7 @@
|
||||
"dashboard.media.media.dragAndDrop": "You can also drag and drop images from your desktop and select them once uploaded.",
|
||||
"dashboard.media.media.folder.upload": "Upload to {0}",
|
||||
"dashboard.media.media.folder.default": "No folder selected, files you drop will be added to the {0} folder",
|
||||
"dashboard.media.media.placeholder": "No media files to show. You can drag & drop new files by holding your [shift] key.",
|
||||
"dashboard.media.media.placeholder": "No media files to show. You can drag&drop new files by holding your [shift] key.",
|
||||
"dashboard.media.media.contentFolder": "Content folder",
|
||||
"dashboard.media.media.publicFolder": "Public folder",
|
||||
|
||||
@@ -226,6 +275,8 @@
|
||||
"dashboard.preview.button.refresh.title": "Refresh",
|
||||
"dashboard.preview.button.open.title": "Open",
|
||||
|
||||
"dashboard.snippetsView.item.type.content": "Content snippet",
|
||||
"dashboard.snippetsView.item.type.media": "Media snippet",
|
||||
"dashboard.snippetsView.item.quickAction.editSnippet": "Edit snippet",
|
||||
"dashboard.snippetsView.item.quickAction.deleteSnippet": "Delete snippet",
|
||||
"dashboard.snippetsView.item.quickAction.viewSnippet": "View snippet file",
|
||||
@@ -272,6 +323,8 @@
|
||||
"dashboard.steps.stepsToGetStarted.contentFolders.information.description": "You can also perform this action by right-clicking on the folder in the explorer view, and selecting register folder",
|
||||
"dashboard.steps.stepsToGetStarted.tags.name": "Import all tags and categories (optional)",
|
||||
"dashboard.steps.stepsToGetStarted.tags.description": "Now that Front Matter knows all the content folders. Would you like to import all tags and categories from the available content?",
|
||||
"dashboard.steps.stepsToGetStarted.git.name": "Do you want to enable Git synchronization?",
|
||||
"dashboard.steps.stepsToGetStarted.git.description": "Enable Git synchronization to eaily sync your changes with your repository.",
|
||||
"dashboard.steps.stepsToGetStarted.showDashboard.name": "Show the dashboard",
|
||||
"dashboard.steps.stepsToGetStarted.showDashboard.description": "Once all actions are completed, the dashboard can be loaded.",
|
||||
"dashboard.steps.stepsToGetStarted.template.name": "Use a configuration template",
|
||||
@@ -280,6 +333,7 @@
|
||||
"dashboard.steps.stepsToGetStarted.astroContentTypes.name": "Create Content-Types for your Astro Content Collections",
|
||||
|
||||
"dashboard.taxonomyView.button.add.title": "Add {0} to taxonomy settings",
|
||||
"dashboard.taxonomyView.button.tag.title": "Tag content",
|
||||
"dashboard.taxonomyView.button.edit.title": "Edit {0}",
|
||||
"dashboard.taxonomyView.button.merge.title": "Merge {0}",
|
||||
"dashboard.taxonomyView.button.move.title": "Move to another taxonomy type",
|
||||
@@ -294,6 +348,10 @@
|
||||
"dashboard.taxonomyView.taxonomyManager.table.heading.action": "Action",
|
||||
"dashboard.taxonomyView.taxonomyManager.table.row.empty": "No {0} found",
|
||||
"dashboard.taxonomyView.taxonomyManager.table.unmapped.title": "Missing in your settings",
|
||||
"dashboard.taxonomyView.taxonomyManager.filterInput.placeholder": "Filter",
|
||||
|
||||
"dashboard.taxonomyView.taxonomyTagging.pageTitle": "Map your content with: {0}",
|
||||
"dashboard.taxonomyView.taxonomyTagging.checkbox": "Tag page with {0}",
|
||||
|
||||
"dashboard.taxonomyView.taxonomyView.navigationBar.title": "Select the taxonomy",
|
||||
"dashboard.taxonomyView.taxonomyView.button.import": "Import taxonomy",
|
||||
@@ -322,6 +380,11 @@
|
||||
"dashboard.configuration.astro.astroContentTypes.empty": "No Astro Content Collections found.",
|
||||
"dashboard.configuration.astro.astroContentTypes.description": "The following Astro Content Collections can be used to generate a content-type.",
|
||||
|
||||
"panel.git.gitAction.title": "Publish changes",
|
||||
"panel.git.gitAction.branch.select": "Select branch",
|
||||
"panel.git.gitAction.input.placeholder": "Commit message",
|
||||
"panel.git.gitAction.button.fetch": "Fetch",
|
||||
|
||||
"panel.contentType.contentTypeValidator.title": "Content-type",
|
||||
"panel.contentType.contentTypeValidator.hint": "We noticed field differences between the content-type and the front matter data. \n Would you like to create, update, or set the content-type for this content?",
|
||||
"panel.contentType.contentTypeValidator.button.create": "Create content-type",
|
||||
@@ -368,6 +431,7 @@
|
||||
"panel.fields.slugField.generate": "Generate slug",
|
||||
|
||||
"panel.fields.textField.ai.message": "Use Front Matter AI to suggest {0}",
|
||||
"panel.fields.textField.copilot.message": "Use Copilot to suggest {0}",
|
||||
"panel.fields.textField.ai.generate": "Generating suggestion...",
|
||||
"panel.fields.textField.loading": "Loading field",
|
||||
"panel.fields.textField.limit": "Field limit reached {0}",
|
||||
@@ -407,6 +471,7 @@
|
||||
"panel.globalSettings.action.server.placeholder": "Example: {0}",
|
||||
|
||||
"panel.metadata.title": "Metadata",
|
||||
"panel.metadata.focusProblems": "Check the problems view for more information",
|
||||
|
||||
"panel.otherActions.title": "Other actions",
|
||||
"panel.otherActions.writingSettings.enabled": "Writing settings enabled",
|
||||
@@ -457,6 +522,7 @@
|
||||
"panel.tagPicker.inputPlaceholder.empty": "Pick your {0}",
|
||||
"panel.tagPicker.inputPlaceholder.disabled": "You have reached the limit of {0}",
|
||||
"panel.tagPicker.ai.suggest": "Use Front Matter AI to suggest {0}",
|
||||
"panel.tagPicker.copilot.suggest": "Use GitHub Copilot to suggest {0}",
|
||||
"panel.tagPicker.ai.generating": "Generating suggestions...",
|
||||
"panel.tagPicker.limit": "Max.: {0}",
|
||||
"panel.tagPicker.unkown": "Add the unknown tag",
|
||||
@@ -465,10 +531,12 @@
|
||||
|
||||
"panel.viewPanel.mediaInsert": "Continue in the media dashboard to select the image you want to insert.",
|
||||
|
||||
"commands.article.notification.noTaxonomy": "No {0} configured.",
|
||||
"commands.article.quickPick.placeholder": "Select your {0} to insert.",
|
||||
"commands.article.setDate.error": "Something failed while parsing the date format. Check your \"{0}\" setting.",
|
||||
"commands.article.updateSlug.error": "Failed to rename file: {0}",
|
||||
"commands.article.rename.fileNotExists.error": "The file did not exist",
|
||||
"commands.article.rename.fileExists.error": "A file with the name \"{0}\" already exists",
|
||||
"commands.article.rename.fileName.title": "Rename: {0}",
|
||||
"commands.article.rename.fileName.prompt": "File name",
|
||||
|
||||
"commands.cache.cleared": "Cache cleared",
|
||||
|
||||
@@ -496,6 +564,19 @@
|
||||
"commands.folders.get.notificationError.remove.action": "Remove folder",
|
||||
"commands.folders.get.notificationError.create.action": "Create folder",
|
||||
|
||||
"commands.i18n.create.warning.noFileSelected": "No file selected.",
|
||||
"commands.i18n.create.warning.noFile": "The file could not be retrieved.",
|
||||
"commands.i18n.create.warning.noContentType": "Content type could not be retrieved for the current file.",
|
||||
"commands.i18n.create.warning.noConfig": "No i18n configuration found.",
|
||||
"commands.i18n.create.error.noLocaleDefinition": "Could not retrieve the locale for the current file.",
|
||||
"commands.i18n.create.error.noLocales": "Current file has been translated to all available languages.",
|
||||
"commands.i18n.create.error.noContentFolder": "Could not define a content folder for the current file.",
|
||||
"commands.i18n.create.error.fileExists": "The i18n translation already exists.",
|
||||
"commands.i18n.create.success.created": "Created \"{0}\" i18n content file.",
|
||||
"commands.i18n.create.quickPick.title": "Create content for locale",
|
||||
"commands.i18n.create.quickPick.placeHolder": "To which locale do you want to create a new content?",
|
||||
"commands.i18n.translate.progress.title": "Translating content...",
|
||||
|
||||
"commands.preview.panel.title": "Preview: {0}",
|
||||
"commands.preview.askUserToPickFolder.title": "Select the folder of the article to preview",
|
||||
|
||||
@@ -606,9 +687,6 @@
|
||||
"helpers.extension.getVersion.changelog": "Check the changelog",
|
||||
"helpers.extension.getVersion.starIt": "Give it a ⭐️",
|
||||
"helpers.extension.getVersion.update.notification": "{0} has been updated to v{1} — check out what's new!",
|
||||
"helpers.extension.migrateSettings.deprecated.warning": "The \"{0}\" and \"{1}\" settings have been deprecated. Please use the \"isPublishDate\" and \"isModifiedDate\" datetime field properties instead.",
|
||||
"helpers.extension.migrateSettings.deprecated.warning.hide": "Hide",
|
||||
"helpers.extension.migrateSettings.deprecated.warning.seeGuide": "See migration guide",
|
||||
"helpers.extension.migrateSettings.templates.quickPick.title": "{0} - Templates",
|
||||
"helpers.extension.migrateSettings.templates.quickPick.placeholder": "Do you want to keep on using the template functionality?",
|
||||
"helpers.extension.checkIfExtensionCanRun.warning": "Front Matter BETA cannot be used while the stable version is installed. Please ensure that you have only over version installed.",
|
||||
@@ -628,9 +706,11 @@
|
||||
"helpers.questions.contentTitle.aiInput.placeholder": "What would you like to write about?",
|
||||
"helpers.questions.contentTitle.aiInput.quickPick.title.separator": "your title/description",
|
||||
"helpers.questions.contentTitle.aiInput.quickPick.ai.separator": "AI generated title",
|
||||
"helpers.questions.contentTitle.aiInput.quickPick.copilot.separator": "GitHub Copilot suggestions",
|
||||
"helpers.questions.contentTitle.aiInput.select.title": "Select a title",
|
||||
"helpers.questions.contentTitle.aiInput.select.placeholder": "Select a title for your content",
|
||||
"helpers.questions.contentTitle.aiInput.failed": "Failed fetching the AI title. Please try to use your own title or try again later.",
|
||||
"helpers.questions.contentTitle.copilotInput.failed": "Failed fetching the GitHub Copilot title suggestions. Please try to use your own title or try again later.",
|
||||
"helpers.questions.contentTitle.aiInput.warning": "You did not specify a title for your content.",
|
||||
"helpers.questions.contentTitle.titleInput.title": "Content title",
|
||||
"helpers.questions.contentTitle.titleInput.prompt": "What would you like to use as a title for the content to create?",
|
||||
@@ -638,12 +718,12 @@
|
||||
"helpers.questions.contentTitle.titleInput.warning": "You did not specify a title for your content.",
|
||||
"helpers.questions.selectContentFolder.quickPick.title": "Select a folder",
|
||||
"helpers.questions.selectContentFolder.quickPick.placeholder": "Select where you want to create your content",
|
||||
"helpers.questions.selectContentFolder.quickPick.noFolders.warning": "No page folders were configured.",
|
||||
"helpers.questions.selectContentFolder.quickPick.noSelection.warning": "You didn't select a place where you wanted to create your content.",
|
||||
"helpers.questions.selectContentType.noContentType.warning": "No content types found. Please create a content type first.",
|
||||
"helpers.questions.selectContentType.quickPick.title": "Content type",
|
||||
"helpers.questions.selectContentType.quickPick.placeholder": "Select the content type to create your new content",
|
||||
"helpers.questions.selectContentType.noSelection.warning": "No content type was selected.",
|
||||
"helpers.questions.selectContentType.quickPick.error.noContentTypes": "There are no matching content types configured for this folder.",
|
||||
|
||||
"helpers.seoHelper.checkLength.diagnostic.message": "Article {0} is longer than {1} characters (current length: {2}). For SEO reasons, it would be better to make it less than {1} characters.",
|
||||
|
||||
@@ -652,6 +732,7 @@
|
||||
"helpers.settingsHelper.readConfig.progress.title": "{0}: Reading dynamic config file...",
|
||||
"helpers.settingsHelper.readConfig.error": "Error reading your configuration.",
|
||||
"helpers.settingsHelper.refreshConfig.success": "Settings have been refreshed.",
|
||||
"helpers.settingsHelper.safeUpdate.warning": "Cannot update setting \"{0}\" because you've extended or split the Front Matter CMS configuration. Please manually add your changes. Check the output for the setting update.",
|
||||
|
||||
"helpers.taxonomyHelper.rename.input.title": "Rename the {0}",
|
||||
"helpers.taxonomyHelper.rename.validate.equalValue": "The new value must be different from the old one.",
|
||||
@@ -664,9 +745,11 @@
|
||||
"helpers.taxonomyHelper.createNew.input.placeholder": "Enter the value you want to add",
|
||||
"helpers.taxonomyHelper.createNew.input.validate.noValue": "A value must be provided.",
|
||||
"helpers.taxonomyHelper.createNew.input.validate.exists": "The value already exists.",
|
||||
"helpers.taxonomyHelper.process.insert": "{0}: Inserting \"{1}\" to your selected pages.",
|
||||
"helpers.taxonomyHelper.process.edit": "{0}: Renaming \"{1}\" from {2} to {3}.",
|
||||
"helpers.taxonomyHelper.process.merge": "{0}: Merging \"{1}\" from {2} to {3}.",
|
||||
"helpers.taxonomyHelper.process.delete": "{0}: Deleting \"{1}\" from {2}.",
|
||||
"helpers.taxonomyHelper.process.insert.success": "Insert completed.",
|
||||
"helpers.taxonomyHelper.process.edit.success": "Edit completed.",
|
||||
"helpers.taxonomyHelper.process.merge.success": "Merge completed.",
|
||||
"helpers.taxonomyHelper.process.delete.success": "Deletion completed.",
|
||||
@@ -684,6 +767,7 @@
|
||||
"listeners.dashboard.settingsListener.triggerTemplate.progress.title": "Downloading and initializing the template...",
|
||||
"listeners.dashboard.settingsListener.triggerTemplate.download.error": "Failed to download the template.",
|
||||
"listeners.dashboard.settingsListener.triggerTemplate.init.error": "Failed to initialize the template.",
|
||||
"listeners.dashboard.settingsListener.setSecretValue.message": "Setting has been updated.",
|
||||
|
||||
"listeners.dashboard.snippetListener.addSnippet.missingFields.warning": "Snippet missing title or body",
|
||||
"listeners.dashboard.snippetListener.addSnippet.exists.warning": "Snippet with the same title already exists",
|
||||
@@ -694,11 +778,14 @@
|
||||
"listeners.panel.dataListener.aiSuggestTaxonomy.noEditor.error": "No active editor",
|
||||
"listeners.panel.dataListener.aiSuggestTaxonomy.noData.error": "No article data",
|
||||
"listeners.panel.dataListener.getDataFileEntries.noDataFiles.error": "Couldn't find data file entries",
|
||||
"listeners.panel.dataListener.pushMetadata.frontMatter.error": "Something went wrong while parsing your front matter. Please check the contents of your file.",
|
||||
|
||||
|
||||
"listeners.panel.taxonomyListener.aiSuggestTaxonomy.noEditor.error": "No active editor",
|
||||
"listeners.panel.taxonomyListener.aiSuggestTaxonomy.noData.error": "No article data",
|
||||
|
||||
"services.copilot.getChatResponse.error": "Failed to get a response from the GitHub Copilot.",
|
||||
|
||||
"services.modeSwitch.switchMode.quickPick.placeholder": "Select the mode you want to use",
|
||||
"services.modeSwitch.switchMode.quickPick.title": "{0}: Mode selection",
|
||||
"services.modeSwitch.setText.mode": "Mode: {0}",
|
||||
|
||||
18431
package-lock.json
generated
389
package.json
@@ -3,7 +3,7 @@
|
||||
"displayName": "Front Matter CMS",
|
||||
"description": "Front Matter is a CMS that runs within Visual Studio Code. It gives you the power and control of a full-blown CMS while also providing you the flexibility and speed of the static site generator of your choice like: Hugo, Jekyll, Docusaurus, NextJs, Gatsby, and many more...",
|
||||
"icon": "assets/frontmatter-teal-128x128.png",
|
||||
"version": "9.4.0",
|
||||
"version": "10.3.0",
|
||||
"preview": false,
|
||||
"publisher": "eliostruyf",
|
||||
"galleryBanner": {
|
||||
@@ -27,10 +27,11 @@
|
||||
},
|
||||
"qna": "https://github.com/estruyf/vscode-front-matter/discussions",
|
||||
"engines": {
|
||||
"vscode": "^1.73.0"
|
||||
"vscode": "^1.90.0"
|
||||
},
|
||||
"l10n": "./l10n",
|
||||
"categories": [
|
||||
"AI",
|
||||
"Other"
|
||||
],
|
||||
"keywords": [
|
||||
@@ -51,8 +52,7 @@
|
||||
},
|
||||
"activationEvents": [
|
||||
"workspaceContains:**/.frontmatter",
|
||||
"workspaceContains:**/frontmatter.json",
|
||||
"onStartupFinished"
|
||||
"workspaceContains:**/frontmatter.json"
|
||||
],
|
||||
"main": "./dist/extension.js",
|
||||
"contributes": {
|
||||
@@ -76,6 +76,12 @@
|
||||
"command": "frontMatter.dashboard",
|
||||
"key": "alt+d"
|
||||
},
|
||||
{
|
||||
"command": "workbench.action.webview.reloadWebviewAction",
|
||||
"key": "ctrl+r",
|
||||
"mac": "cmd+r",
|
||||
"when": "activeWebviewPanelId == frontMatterDashboard"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.insertMedia",
|
||||
"key": "ctrl+shift+i",
|
||||
@@ -293,6 +299,10 @@
|
||||
"default": null,
|
||||
"description": "%setting.frontMatter.content.pageFolders.items.properties.previewPath.description%"
|
||||
},
|
||||
"trailingSlash": {
|
||||
"type": "boolean",
|
||||
"description": "%setting.frontMatter.content.pageFolders.items.properties.trailingSlash.description%"
|
||||
},
|
||||
"filePrefix": {
|
||||
"type": [
|
||||
"null",
|
||||
@@ -311,6 +321,17 @@
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "%setting.frontMatter.content.pageFolders.items.properties.disableCreation.description%"
|
||||
},
|
||||
"defaultLocale": {
|
||||
"type": "string",
|
||||
"description": "%setting.frontMatter.content.pageFolders.items.properties.defaultLocale.description%"
|
||||
},
|
||||
"locales": {
|
||||
"type": "array",
|
||||
"description": "%setting.frontMatter.content.pageFolders.items.properties.locales.description%",
|
||||
"items": {
|
||||
"$ref": "#i18n"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
@@ -321,6 +342,35 @@
|
||||
},
|
||||
"scope": "Content"
|
||||
},
|
||||
"frontMatter.content.i18n": {
|
||||
"type": "array",
|
||||
"default": [],
|
||||
"markdownDescription": "%setting.frontMatter.content.i18n.markdownDescription%",
|
||||
"items": {
|
||||
"$id": "#i18n",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"title": {
|
||||
"type": "string",
|
||||
"description": "%setting.frontMatter.content.i18n.items.properties.title.description%"
|
||||
},
|
||||
"locale": {
|
||||
"type": "string",
|
||||
"description": "%setting.frontMatter.content.i18n.items.properties.locale.description%"
|
||||
},
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "%setting.frontMatter.content.i18n.items.properties.path.description%"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"locale",
|
||||
"path"
|
||||
]
|
||||
},
|
||||
"scope": "Content"
|
||||
},
|
||||
"frontMatter.content.placeholders": {
|
||||
"type": "array",
|
||||
"default": [],
|
||||
@@ -492,6 +542,36 @@
|
||||
"markdownDescription": "%setting.frontMatter.content.wysiwyg.markdownDescription%",
|
||||
"scope": "Content"
|
||||
},
|
||||
"frontMatter.content.filters": {
|
||||
"type": "array",
|
||||
"default": [
|
||||
"contentFolders",
|
||||
"tags",
|
||||
"categories"
|
||||
],
|
||||
"markdownDescription": "%setting.frontMatter.content.filters.markdownDescription%",
|
||||
"items": [
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"contentFolders",
|
||||
"tags",
|
||||
"categories"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"frontMatter.custom.scripts": {
|
||||
"type": "array",
|
||||
"default": [],
|
||||
@@ -647,17 +727,6 @@
|
||||
"default": "",
|
||||
"markdownDescription": "%setting.frontMatter.dashboard.content.card.fields.title.markdownDescription%"
|
||||
},
|
||||
"frontMatter.dashboard.mediaSnippet": {
|
||||
"type": "array",
|
||||
"default": [],
|
||||
"markdownDescription": "%setting.frontMatter.dashboard.mediaSnippet.markdownDescription%",
|
||||
"deprecationMessage": "%setting.frontMatter.dashboard.mediaSnippet.deprecationMessage%",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"description": "%setting.frontMatter.dashboard.mediaSnippet.items.description%"
|
||||
},
|
||||
"scope": "dashboard"
|
||||
},
|
||||
"frontMatter.dashboard.openOnStart": {
|
||||
"type": [
|
||||
"boolean",
|
||||
@@ -874,6 +943,22 @@
|
||||
"markdownDescription": "%setting.frontMatter.git.commitMessage.markdownDescription%",
|
||||
"default": "Synced by Front Matter"
|
||||
},
|
||||
"frontMatter.git.disableOnBranches": {
|
||||
"type": "array",
|
||||
"markdownDescription": "%setting.frontMatter.git.disableOnBranches.markdownDescription%",
|
||||
"default": [],
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"frontMatter.git.requiresCommitMessage": {
|
||||
"type": "array",
|
||||
"markdownDescription": "%setting.frontMatter.git.requiresCommitMessage.markdownDescription%",
|
||||
"default": [],
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"frontMatter.git.submodule.pull": {
|
||||
"type": "boolean",
|
||||
"markdownDescription": "%setting.frontMatter.git.submodule.pull.markdownDescription%",
|
||||
@@ -982,6 +1067,82 @@
|
||||
"markdownDescription": "%setting.frontMatter.media.defaultSorting.markdownDescription%",
|
||||
"scope": "Content"
|
||||
},
|
||||
"frontMatter.media.contentTypes": {
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"markdownDescription": "%setting.frontMatter.media.contentTypes.markdownDescription%",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"description": "%setting.frontMatter.media.contentTypes.items.description%",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "%setting.frontMatter.media.contentTypes.items.properties.name.description%"
|
||||
},
|
||||
"fileTypes": {
|
||||
"type": "array",
|
||||
"description": "%setting.frontMatter.media.contentTypes.items.properties.fileTypes.description%",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"fields": {
|
||||
"type": "array",
|
||||
"description": "%setting.frontMatter.media.contentTypes.items.properties.fields.description%",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"title": {
|
||||
"type": "string",
|
||||
"description": "%setting.frontMatter.media.contentTypes.items.properties.fields.properties.title.description%"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "%setting.frontMatter.media.contentTypes.items.properties.fields.properties.name.description%"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"string"
|
||||
],
|
||||
"description": "%setting.frontMatter.media.contentTypes.items.properties.fields.properties.type.description%"
|
||||
},
|
||||
"single": {
|
||||
"type": "boolean",
|
||||
"description": "%setting.frontMatter.media.contentTypes.items.properties.fields.properties.single.description%"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"default": [
|
||||
{
|
||||
"name": "default",
|
||||
"fileTypes": null,
|
||||
"fields": [
|
||||
{
|
||||
"title": "Title",
|
||||
"name": "title",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"title": "Caption",
|
||||
"name": "caption",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"title": "Alt text",
|
||||
"name": "alt",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"scope": "Media"
|
||||
},
|
||||
"frontMatter.media.supportedMimeTypes": {
|
||||
"type": "array",
|
||||
"default": [
|
||||
@@ -1030,6 +1191,12 @@
|
||||
"markdownDescription": "%setting.frontMatter.preview.pathName.markdownDescription%",
|
||||
"scope": "Site preview"
|
||||
},
|
||||
"frontMatter.preview.trailingSlash": {
|
||||
"type": "boolean",
|
||||
"default": "",
|
||||
"markdownDescription": "%setting.frontMatter.preview.trailingSlash.markdownDescription%",
|
||||
"scope": "Site preview"
|
||||
},
|
||||
"frontMatter.site.baseURL": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
@@ -1576,6 +1743,18 @@
|
||||
"default": null,
|
||||
"description": "%setting.frontMatter.taxonomy.contentTypes.items.properties.previewPath.description%"
|
||||
},
|
||||
"trailingSlash": {
|
||||
"type": "boolean",
|
||||
"description": "%setting.frontMatter.taxonomy.contentTypes.items.properties.trailingSlash.description%"
|
||||
},
|
||||
"slugTemplate": {
|
||||
"type": [
|
||||
"null",
|
||||
"string"
|
||||
],
|
||||
"default": null,
|
||||
"description": "%setting.frontMatter.content.pageFolders.items.properties.slugTemplate.description%"
|
||||
},
|
||||
"template": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
@@ -1691,12 +1870,6 @@
|
||||
},
|
||||
"scope": "Taxonomy"
|
||||
},
|
||||
"frontMatter.taxonomy.dateField": {
|
||||
"type": "string",
|
||||
"default": "date",
|
||||
"markdownDescription": "%setting.frontMatter.taxonomy.dateField.markdownDescription%",
|
||||
"deprecationMessage": "%setting.frontMatter.taxonomy.dateField.deprecationMessage%"
|
||||
},
|
||||
"frontMatter.taxonomy.dateFormat": {
|
||||
"type": "string",
|
||||
"markdownDescription": "%setting.frontMatter.taxonomy.dateFormat.markdownDescription%",
|
||||
@@ -1750,12 +1923,6 @@
|
||||
"markdownDescription": "%setting.frontMatter.taxonomy.indentArrays.markdownDescription%",
|
||||
"scope": "Taxonomy"
|
||||
},
|
||||
"frontMatter.taxonomy.modifiedField": {
|
||||
"type": "string",
|
||||
"default": "lastmod",
|
||||
"markdownDescription": "%setting.frontMatter.taxonomy.modifiedField.markdownDescription%",
|
||||
"deprecationMessage": "%setting.frontMatter.taxonomy.modifiedField.deprecationMessage%"
|
||||
},
|
||||
"frontMatter.taxonomy.quoteStringValues": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
@@ -1818,6 +1985,11 @@
|
||||
"markdownDescription": "%setting.frontMatter.taxonomy.slugSuffix.markdownDescription%",
|
||||
"scope": "Taxonomy"
|
||||
},
|
||||
"frontMatter.taxonomy.slugTemplate": {
|
||||
"type": "string",
|
||||
"markdownDescription": "%setting.frontMatter.taxonomy.slugTemplate.markdownDescription%",
|
||||
"scope": "Taxonomy"
|
||||
},
|
||||
"frontMatter.taxonomy.tags": {
|
||||
"type": "array",
|
||||
"markdownDescription": "%setting.frontMatter.taxonomy.tags.markdownDescription%",
|
||||
@@ -1852,6 +2024,16 @@
|
||||
"frontMatter.website.host": {
|
||||
"type": "string",
|
||||
"markdownDescription": "%setting.frontMatter.website.host.markdownDescription%"
|
||||
},
|
||||
"frontMatter.logging": {
|
||||
"type": "string",
|
||||
"default": "info",
|
||||
"enum": [
|
||||
"error",
|
||||
"warn",
|
||||
"info",
|
||||
"verbose"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -2109,6 +2291,12 @@
|
||||
"title": "%command.frontMatter.preview%",
|
||||
"category": "Front Matter"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.docs",
|
||||
"title": "%command.frontMatter.docs%",
|
||||
"category": "Front Matter",
|
||||
"icon": "$(book)"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.chatbot",
|
||||
"title": "%command.frontMatter.chatbot%",
|
||||
@@ -2171,6 +2359,15 @@
|
||||
"command": "frontMatter.cache.clear",
|
||||
"title": "%command.frontMatter.cache.clear%",
|
||||
"category": "Front Matter"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.i18n.create",
|
||||
"title": "%command.frontMatter.i18n.create%",
|
||||
"category": "Front Matter",
|
||||
"icon": {
|
||||
"light": "assets/icons/i18n-light.svg",
|
||||
"dark": "assets/icons/i18n-dark.svg"
|
||||
}
|
||||
}
|
||||
],
|
||||
"submenus": [
|
||||
@@ -2180,6 +2377,12 @@
|
||||
}
|
||||
],
|
||||
"menus": {
|
||||
"webview/context": [
|
||||
{
|
||||
"command": "workbench.action.webview.openDeveloperTools",
|
||||
"when": "frontMatter:isDevelopment"
|
||||
}
|
||||
],
|
||||
"editor/title": [
|
||||
{
|
||||
"command": "frontMatter.markup.heading",
|
||||
@@ -2211,6 +2414,11 @@
|
||||
"group": "navigation@-128",
|
||||
"when": "frontMatter:file:isValid == true"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.i18n.create",
|
||||
"group": "navigation@-127",
|
||||
"when": "frontMatter:file:isValid && frontMatter:i18n:enabled"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.markup.options",
|
||||
"group": "navigation@-126",
|
||||
@@ -2294,14 +2502,6 @@
|
||||
"command": "frontMatter.project.switch",
|
||||
"when": "frontMatter:project:switch:enabled"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.createTemplate",
|
||||
"when": "!frontMatterCanInit"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.preview",
|
||||
"when": "frontMatterCanOpenPreview"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.dashboard.data",
|
||||
"when": "frontMatter:dashboard:data:enabled"
|
||||
@@ -2314,10 +2514,30 @@
|
||||
"command": "frontMatter.git.sync",
|
||||
"when": "frontMatter:git:enabled"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.i18n.create",
|
||||
"when": "frontMatter:i18n:enabled"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.authenticate",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.collapseSections",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.remap",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.insertTags",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.insertCategories",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.registerFolder",
|
||||
"when": "false"
|
||||
@@ -2378,6 +2598,38 @@
|
||||
"command": "frontMatter.markup.options",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.markup.hyperlink",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.config.reload",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.initTemplate",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.createTemplate",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.contenttype.addMissingFields",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.exportTaxonomy",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.generateSlug",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.promoteSettings",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.insertSnippet",
|
||||
"when": "frontMatter:file:isValid == true && frontMatter:dashboard:snippets:enabled"
|
||||
@@ -2398,14 +2650,6 @@
|
||||
"command": "frontMatter.insertCategories",
|
||||
"when": "frontMatter:file:isValid == true"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.insertTags",
|
||||
"when": "frontMatter:file:isValid == true"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.createTemplate",
|
||||
"when": "frontMatter:file:isValid == true"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.preview",
|
||||
"when": "frontMatter:file:isValid == true"
|
||||
@@ -2422,16 +2666,17 @@
|
||||
"command": "frontMatter.contenttype.generate",
|
||||
"when": "frontMatter:file:isValid == true"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.contenttype.addMissingFields",
|
||||
"when": "frontMatter:file:isValid == true"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.contenttype.setContentType",
|
||||
"when": "frontMatter:file:isValid == true"
|
||||
}
|
||||
],
|
||||
"view/title": [
|
||||
{
|
||||
"command": "frontMatter.docs",
|
||||
"group": "navigation@-1",
|
||||
"when": "view == frontMatter.explorer"
|
||||
},
|
||||
{
|
||||
"command": "frontMatter.chatbot",
|
||||
"group": "navigation@0",
|
||||
@@ -2464,6 +2709,14 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"languages": [
|
||||
{
|
||||
"id": "frontmatter.project.output",
|
||||
"mimetypes": [
|
||||
"text/x-code-output"
|
||||
]
|
||||
}
|
||||
],
|
||||
"grammars": [
|
||||
{
|
||||
"path": "./syntaxes/hugo.tmLanguage.json",
|
||||
@@ -2471,6 +2724,11 @@
|
||||
"injectTo": [
|
||||
"text.html.markdown"
|
||||
]
|
||||
},
|
||||
{
|
||||
"language": "frontmatter.project.output",
|
||||
"scopeName": "frontmatter.project.output",
|
||||
"path": "./syntaxes/frontmatter-output.tmLanguage.json"
|
||||
}
|
||||
],
|
||||
"walkthroughs": [
|
||||
@@ -2531,9 +2789,6 @@
|
||||
"prod:panel": "webpack --mode production --config ./webpack/panel.config.js",
|
||||
"test-compile": "tsc -p ./",
|
||||
"clean": "rimraf dist",
|
||||
"start:site": "cd ./docs && npm run dev",
|
||||
"clean:test": "rm ./e2e/sample/frontmatter.json || exit 0 && rm -rf ./e2e/sample/.frontmatter || exit 0",
|
||||
"test": "npm run lint; tsc -p tsconfig.e2e.json && npm run clean:test && npm run i -g @vscode/vsce && node ./e2e/out/runTests.js",
|
||||
"lint": "eslint --max-warnings=0 ./src/{commands,components}",
|
||||
"prettier": "prettier --write ./src",
|
||||
"localization:watch": "node ./scripts/watch-localization.js",
|
||||
@@ -2543,36 +2798,30 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
"@bendera/vscode-webview-elements": "0.6.2",
|
||||
"@estruyf/vscode": "^1.1.0",
|
||||
"@headlessui/react": "^1.7.17",
|
||||
"@heroicons/react": "1.0.4",
|
||||
"@headlessui/react": "^1.7.18",
|
||||
"@heroicons/react": "^2.1.1",
|
||||
"@iarna/toml": "2.2.3",
|
||||
"@octokit/rest": "^18.12.0",
|
||||
"@popperjs/core": "^2.11.6",
|
||||
"@sentry/react": "^6.19.7",
|
||||
"@sentry/tracing": "^6.19.7",
|
||||
"@tailwindcss/forms": "^0.5.3",
|
||||
"@types/chai": "^4.3.4",
|
||||
"@types/glob": "7.1.3",
|
||||
"@types/invariant": "^2.2.35",
|
||||
"@types/js-yaml": "3.12.1",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/lodash.omit": "^4.5.7",
|
||||
"@types/lodash.uniqby": "4.7.6",
|
||||
"@types/lodash.xor": "^4.5.7",
|
||||
"@types/mdast": "^3.0.10",
|
||||
"@types/mime-types": "^2.1.1",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/mustache": "^4.2.2",
|
||||
"@types/node": "10.17.48",
|
||||
"@types/node-fetch": "^2.6.2",
|
||||
"@types/node": "^18.17.1",
|
||||
"@types/react": "17.0.0",
|
||||
"@types/react-datepicker": "^4.8.0",
|
||||
"@types/react-dom": "17.0.0",
|
||||
"@types/vscode": "^1.73.0",
|
||||
"@types/vscode": "^1.90.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.50.0",
|
||||
"@typescript-eslint/parser": "^5.50.0",
|
||||
"@vscode/codicons": "0.0.20",
|
||||
"@vscode-elements/elements": "^1.2.0",
|
||||
"@vscode/l10n": "^0.0.14",
|
||||
"@vscode/webview-ui-toolkit": "^1.2.2",
|
||||
"@webpack-cli/serve": "^1.7.0",
|
||||
@@ -2580,8 +2829,8 @@
|
||||
"array-move": "^4.0.0",
|
||||
"assert": "^2.0.0",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"chai": "^4.3.7",
|
||||
"cheerio": "1.0.0-rc.12",
|
||||
"clsx": "^2.1.0",
|
||||
"css-loader": "5.2.7",
|
||||
"date-fns": "2.23.0",
|
||||
"dotenv": "^16.3.1",
|
||||
@@ -2589,7 +2838,7 @@
|
||||
"eslint": "^8.33.0",
|
||||
"fuse.js": "6.5.3",
|
||||
"github-directory-downloader": "^1.3.6",
|
||||
"glob": "7.1.6",
|
||||
"glob": "^10.3.12",
|
||||
"gray-matter": "4.0.3",
|
||||
"html-loader": "1.3.2",
|
||||
"html-webpack-plugin": "4.5.0",
|
||||
@@ -2603,9 +2852,7 @@
|
||||
"lodash.xor": "^4.5.0",
|
||||
"mdast-util-from-markdown": "1.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
"mocha": "^10.2.0",
|
||||
"mustache": "^4.2.0",
|
||||
"node-fetch": "^2.6.9",
|
||||
"node-json-db": "^2.2.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"path-browserify": "^1.0.1",
|
||||
@@ -2619,18 +2866,18 @@
|
||||
"react-dom": "17.0.1",
|
||||
"react-dropzone": "^11.7.1",
|
||||
"react-markdown": "^8.0.7",
|
||||
"react-popper": "^2.3.0",
|
||||
"react-quill": "^2.0.0",
|
||||
"react-router-dom": "^6.8.0",
|
||||
"react-sortable-hoc": "^2.0.0",
|
||||
"react-toastify": "^8.2.0",
|
||||
"recoil": "^0.4.1",
|
||||
"recoil": "^0.7.7",
|
||||
"remark-gfm": "^3.0.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"semver": "^7.3.8",
|
||||
"simple-git": "^3.16.0",
|
||||
"style-loader": "2.0.0",
|
||||
"tailwind-merge": "^2.2.1",
|
||||
"tailwindcss": "^3.2.4",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"ts-loader": "^9.4.2",
|
||||
"typescript": "^4.9.5",
|
||||
"uniforms": "^3.10.2",
|
||||
@@ -2638,7 +2885,6 @@
|
||||
"uniforms-bridge-json-schema": "^3.10.2",
|
||||
"uniforms-unstyled": "^3.10.2",
|
||||
"url-join-ts": "^1.0.5",
|
||||
"vscode-extension-tester": "^5.3.0",
|
||||
"wc-react": "github:estruyf/wc-react",
|
||||
"webpack": "^5.75.0",
|
||||
"webpack-bundle-analyzer": "^4.7.0",
|
||||
@@ -2650,5 +2896,8 @@
|
||||
},
|
||||
"vsce": {
|
||||
"dependencies": false
|
||||
},
|
||||
"dependencies": {
|
||||
"@radix-ui/react-dropdown-menu": "^2.0.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
"command.frontMatter.preview": "記事のプレビューを開く",
|
||||
"command.frontMatter.chatbot": "Front Matter AIに質問する",
|
||||
"command.frontMatter.promoteSettings": "ローカル設定をチームレベルへ昇格させる",
|
||||
"command.frontMatter.remap": "全ての記事のタグまたはカテゴリーを再配置または削除する",
|
||||
"command.frontMatter.remap": "全ての記事のタグまたはカテゴリーを再構成または削除する",
|
||||
"command.frontMatter.setLastModifiedDate": "最終更新日を設定する",
|
||||
"command.frontMatter.markup.strikethrough": "取り消し線",
|
||||
"command.frontMatter.mode.switch": "モードの切り替え",
|
||||
@@ -48,39 +48,49 @@
|
||||
"command.frontMatter.markup.unorderedlist": "順序なしリスト",
|
||||
"command.frontMatter.git.sync": "同期",
|
||||
"command.frontMatter.cache.clear": "キャッシュをクリア",
|
||||
"command.frontMatter.i18n.create": "新しい翻訳を作成",
|
||||
"settings.configuration.title": "Front Matter: チームで作業する場合はfrontmatter.jsonで設定してください。",
|
||||
"setting.frontMatter.projects.markdownDescription": "Front Matter CMSを利用するプロジェクトを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.projects)",
|
||||
"setting.frontMatter.projects.items.properties.name.markdownDescription": "プロジェクトの名前を指定します。",
|
||||
"setting.frontMatter.projects.items.properties.default.markdownDescription": "このプロジェクトを読み込む既定のプロジェクトにするかどうかを指定します。",
|
||||
"setting.frontMatter.sponsors.ai.enabled.markdownDescription": "AIによる提案を利用します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.sponsors.ai.enabled)",
|
||||
"setting.frontMatter.extensibility.scripts.markdownDescription": "Front Matter CMSで読み込むスクリプトのリストを指定します。. [ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.extensibility.scripts)",
|
||||
"setting.frontMatter.extensibility.scripts.markdownDescription": "Front Matter CMSで読み込むスクリプトのリストを指定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.extensibility.scripts)",
|
||||
"setting.frontMatter.experimental.markdownDescription": "実験的な機能をオンにします。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.experimental)",
|
||||
"setting.frontMatter.extends.markdownDescription": "Front Matter CMSの構成を拡張するパス/URLのリストを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.extends)",
|
||||
"setting.frontMatter.content.autoUpdateDate.markdownDescription": "記事やページの最終編集日を自動で更新します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.content.autoupdatedate)",
|
||||
"setting.frontMatter.content.defaultFileType.markdownDescription": "新しい記事を作成する際の既定のファイル形式を設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.content.defaultfiletype)",
|
||||
"setting.frontMatter.content.defaultSorting.markdownDescription": "ダッシュボード上に表示される記事一覧の既定の並び順を設定します。Enum(列挙型)や任意のIDを指定してください。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.content.defaultsorting)",
|
||||
"setting.frontMatter.content.draftField.markdownDescription": "記事の下書きステータスを管理するフィールドを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.content.draftfield)",
|
||||
"setting.frontMatter.content.draftField.properties.type.description": "使用する下書きフィールドの種類",
|
||||
"setting.frontMatter.content.draftField.properties.type.description": "使用する下書きフィールドの型",
|
||||
"setting.frontMatter.content.draftField.properties.name.description": "使用するフィールドの名前",
|
||||
"setting.frontMatter.content.draftField.properties.invert.description": "既定では、コンテンツが下書きの場合、下書きフィールドは true に設定されます。これを true に設定すると、false に設定されます。",
|
||||
"setting.frontMatter.content.draftField.properties.invert.description": "既定では、記事が下書きの場合、下書きフィールドは true に設定されます。これを true に設定すると、false に設定されます。",
|
||||
"setting.frontMatter.content.draftField.properties.choices.description": "フィールドの選択肢のリスト",
|
||||
"setting.frontMatter.content.fmHighlight.markdownDescription": "Markdownファイル内のfront matterをハイライトします。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.content.fmhighlight)",
|
||||
"setting.frontMatter.content.hideFm.markdownDescription": "Markdownファイル内のfront matterを非表示にします。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.content.hidefm)",
|
||||
"setting.frontMatter.content.hideFmMessage.markdownDescription": "front matterが非表示の際に、編集画面に表示するメッセージを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.content.hidefmmessage)",
|
||||
"setting.frontMatter.content.pageFolders.markdownDescription": "フォルダーを配列で定義して、この拡張機能が記事を取得したり新しい記事を作成できるようにします。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.content.pagefolders)",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.title.description": "フォルダの名前",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.path.description": "フォルダのパス",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.title.description": "フォルダーの名前",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.path.description": "フォルダーのパス",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.excludeSubdir.description": "サブディレクトリを除外する",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.previewPath.description": "フォルダーのカスタム プレビュー パスを定義します。",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.filePrefix.description": "ファイル名のプレフィックスを定義します。",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.contentTypes.description": "現在の場所に使用できるコンテンツ タイプを定義します。定義しない場合は、すべてのコンテンツ タイプを使用できます。",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.trailingSlash.description": "プレビュー用URLに末尾のスラッシュを加えるかどうかを設定します。",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.filePrefix.description": "ファイル名の接頭辞を定義します。",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.contentTypes.description": "現在の場所に使用できる記事タイプを定義します。定義しない場合は、全ての記事タイプを使用できます。",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.disableCreation.description": "フォルダー内の新しい記事の作成を無効にします。",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.defaultLocale.description": "ページフォルダー用デフォルトのロケールIDを設定します。このフォルダー内の全ての記事が`frontMatter.content.i18n`で設定された言語へ翻訳可能になります。",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.locales.description": "ページフォルダーで利用するロケールを設定します。この設定は記事の翻訳に使用されます。",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.slugTemplate.description": "カスタムスラッグのテンプレートを定義します。",
|
||||
"setting.frontMatter.content.i18n.markdownDescription": "ウェブサイトで利用するロケールを設定します。この設定はページフォルダーレベルの設定より優先されます。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.content.i18n)",
|
||||
"setting.frontMatter.content.i18n.items.properties.title.description": "言語名",
|
||||
"setting.frontMatter.content.i18n.items.properties.locale.description": "言語コード",
|
||||
"setting.frontMatter.content.i18n.items.properties.path.description": "言語フォルダーの相対パス",
|
||||
"setting.frontMatter.content.placeholders.markdownDescription": "記事タイプとテンプレートで使用するプレースホルダーを配列で定義して、記事のfront matterを自動で入力できるようにします。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.content.placeholders)",
|
||||
"setting.frontMatter.content.placeholders.items.properties.id.description": "プレースホルダーの ID をコンテンツ タイプまたはテンプレートで、次のように使用します: {{placeholder}}",
|
||||
"setting.frontMatter.content.placeholders.items.properties.id.description": "プレースホルダーのIDを記事タイプまたはテンプレートで、次のように使用します: {{placeholder}}",
|
||||
"setting.frontMatter.content.placeholders.items.properties.value.description": "プレースホルダーの値",
|
||||
"setting.frontMatter.content.placeholders.items.properties.script.description": "プレースホルダーの値を取得するために実行するスクリプト",
|
||||
"setting.frontMatter.content.publicFolder.markdownDescription": "アセットが保存されているフォルダーを設定します。例えば、Hugoでは`static`フォルダーです。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.content.publicfolder)",
|
||||
"setting.frontMatter.content.publicFolder.properties.path.description": "アセットフォルダーのパスを指定します。",
|
||||
"setting.frontMatter.content.publicFolder.properties.relative.description": "メディアファイルへのパスがコンテンツファイルに対して相対的であるかを定義します。",
|
||||
"setting.frontMatter.content.publicFolder.properties.relative.description": "メディアファイルへのパスが記事ファイルに対して相対的であるかを定義します。",
|
||||
"setting.frontMatter.snippets.wrapper.enabled.markdownDescription": "スニペット挿入時にコメントでラップします。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontMatter.snippets.wrapper.enabled)",
|
||||
"setting.frontMatter.content.snippets.markdownDescription": "記事中に使用するスニペットを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.content.snippets)",
|
||||
"setting.frontMatter.content.sorting.markdownDescription": "ダッシュボード上での記事の並べ替えオプションを追加します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.content.sorting)",
|
||||
@@ -91,26 +101,28 @@
|
||||
"setting.frontMatter.content.sorting.items.properties.type.description": "フィールド値の型",
|
||||
"setting.frontMatter.content.supportedFileTypes.markdownDescription": "Front Matterでサポートされるファイル形式を設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.content.supportedfiletypes)",
|
||||
"setting.frontMatter.content.wysiwyg.markdownDescription": "What You See, Is What You Get(WYSIWYG)Markdownコントロールを有効にします。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.content.wysiwyg)",
|
||||
"setting.frontMatter.content.filters.markdownDescription": "ダッシュボードで利用するフィルターを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.content.filters)",
|
||||
"setting.frontMatter.custom.scripts.markdownDescription": "実行するNode.jsスクリプトのパスを指定します。現在のファイルのパスが引数として渡されます。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.custom.scripts)",
|
||||
"setting.frontMatter.custom.scripts.items.properties.id.description": "スクリプトの ID。",
|
||||
"setting.frontMatter.custom.scripts.items.properties.title.description": "スクリプトに付けるタイトル。ボタンのタイトルとして表示されます。",
|
||||
"setting.frontMatter.custom.scripts.items.properties.script.description": "実行するスクリプトへのパス",
|
||||
"setting.frontMatter.custom.scripts.items.properties.nodeBin.description": "ノード実行可能ファイルへのパス。これは、使用するノードのバージョンが混同されないように、NVM を使用するときに必要です。(非推奨: 代わりにコマンド プロパティを使用してください)",
|
||||
"setting.frontMatter.custom.scripts.items.properties.bulk.description": "すべてのコンテンツ ファイルに対してスクリプトを実行する",
|
||||
"setting.frontMatter.custom.scripts.items.properties.output.description": "スクリプト出力を出力する場所を定義します。デフォルトは通知ですが、エディターパネルに表示するように指定できます。",
|
||||
"setting.frontMatter.custom.scripts.items.properties.nodeBin.description": "実行可能なNode.jsへのパス。これは、NVMを使用する際に、Node.jsのバージョンが混同されないようにするために必要です。(非推奨: 代わりにコマンドプロパティを使用してください)",
|
||||
"setting.frontMatter.custom.scripts.items.properties.bulk.description": "全ての記事ファイルに対してスクリプトを実行する",
|
||||
"setting.frontMatter.custom.scripts.items.properties.output.description": "スクリプト出力を出力する場所を定義します。デフォルトは通知表示ですが、エディターパネルに表示するように指定できます。",
|
||||
"setting.frontMatter.custom.scripts.items.properties.outputType.description": "エディター・パネルの出力のタイプ。たとえば、「マークダウン」に変更するために使用できます",
|
||||
"setting.frontMatter.custom.scripts.items.properties.type.description": "スクリプトが使用される型。",
|
||||
"setting.frontMatter.custom.scripts.items.properties.command.description": "実行するスクリプトの種類。",
|
||||
"setting.frontMatter.custom.scripts.items.properties.type.description": "スクリプトが使用される型",
|
||||
"setting.frontMatter.custom.scripts.items.properties.command.description": "実行するスクリプトの種類",
|
||||
"setting.frontMatter.custom.scripts.items.properties.hidden.description": "UI からアクションを非表示にする",
|
||||
"setting.frontMatter.custom.scripts.items.properties.environments.items.properties.type.description": "スクリプトを使用する必要がある環境タイプ",
|
||||
"setting.frontMatter.custom.scripts.items.properties.environments.items.properties.script.description": "実行するスクリプトへのパス",
|
||||
"setting.frontMatter.custom.scripts.items.properties.contentTypes.description": "スクリプトを使用する記事タイプを定義します。何も定義されていない場合は、全ての型で使用できます。",
|
||||
"setting.frontMatter.dashboard.content.pagination.markdownDescription": "ページネーションの有効/無効を設定します。ページ数は最大52まで設定できます。規定値は`16`です。ページ分割を無効にするには`false`を設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.dashboard.content.pagination)",
|
||||
"setting.frontMatter.dashboard.content.cardTags.markdownDescription": "記事一覧をカード型で表示する際、どのメタデータフィールドをタグとして使うかを指定します。空欄またはnull値の場合、タグは表示されなくなります。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.dashboard.content.cardtags)",
|
||||
"setting.frontMatter.dashboard.content.card.fields.state.markdownDescription": "記事一覧をカード型で表示する際、下書き・公開済みのステータスを表示します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontMatter.dashboard.content.card.fields.state)",
|
||||
"setting.frontMatter.dashboard.content.card.fields.date.markdownDescription": "記事一覧をカード型で表示する際、日付を表示します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontMatter.dashboard.content.card.fields.date)",
|
||||
"setting.frontMatter.dashboard.content.card.fields.description.markdownDescription": "記事一覧をカード型で表示する際、どのメタデータフィールドをディスクリプションとして使うかを指定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontMatter.dashboard.content.card.fields.description)",
|
||||
"setting.frontMatter.dashboard.content.card.fields.title.markdownDescription": "記事一覧をカード型で表示する際、どのメタデータフィールドをタイトルとして使うかを指定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontMatter.dashboard.content.card.fields.title)",
|
||||
"setting.frontMatter.dashboard.mediaSnippet.markdownDescription": "カスタムメディア挿入マークアップのスニペットを指定します。[ドキュメントをチェックイン](https://frontmatter.codes/docs/settings/overview#frontmatter.dashboard.mediasnippet)",
|
||||
"setting.frontMatter.dashboard.mediaSnippet.markdownDescription": "カスタムメディア挿入マークアップのスニペットを指定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.dashboard.mediasnippet)",
|
||||
"setting.frontMatter.dashboard.mediaSnippet.items.description": "スニペット内で `{mediaUrl}`, `{caption}`, `{alt}`, `{filename}`, `{mediaHeight}`, `{mediaWidth}` のプレースホルダーを使用して、メディア情報を自動的に挿入します。",
|
||||
"setting.frontMatter.dashboard.openOnStart.markdownDescription": "VS Codeの起動時にダッシュボードを表示します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.dashboard.openonstart)",
|
||||
"setting.frontMatter.data.files.markdownDescription": "ウェブサイトに使用するデータのファイルを指定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.data.files)",
|
||||
@@ -148,24 +160,37 @@
|
||||
"setting.frontMatter.global.modes.items.properties.id.description": "モードの ID。",
|
||||
"setting.frontMatter.global.modes.items.properties.features.description": "モードに使用する機能。",
|
||||
"setting.frontMatter.global.notifications.markdownDescription": "表示したい通知を設定します。既定では全ての通知が表示されます。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.global.notifications)",
|
||||
"setting.frontMatter.global.disabledNotificaitons.markdownDescription": "表示しない通知を設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.global.disablednotifications)",
|
||||
"setting.frontMatter.global.disabledNotifications.markdownDescription": "これは、Front Matter CMSで無効にできる通知タイプの配列です。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.global.disablednotifications)",
|
||||
"setting.frontMatter.media.defaultSorting.markdownDescription": "ダッシュボードのメディア一覧での既定の並び順を設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.media.defaultsorting)",
|
||||
"setting.frontMatter.media.supportedMimeTypes.markdownDescription": "メディアファイルでサポートされるMIMEタイプを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.media.supportedmimetypes)",
|
||||
"setting.frontMatter.panel.freeform.markdownDescription": "未登録のタグ/カテゴリーをタグピッカーに入力することを許可するかどうかを設定します(有効にすると、後で保存するオプションが使えます)。規定値はtrue。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.panel.freeform)",
|
||||
"setting.frontMatter.media.supportedMimeTypes.markdownDescription": "メディアコンテンツでサポートされるMIMEタイプを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.media.supportedmimetypes)",
|
||||
|
||||
"setting.frontMatter.media.contentTypes.markdownDescription": "Front Matterで利用するメディアコンテンツのタイプを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.media.contenttypes)",
|
||||
"setting.frontMatter.media.contentTypes.items.description": "Front Matterで利用するメディアフコンテンツのタイプについての説明。",
|
||||
"setting.frontMatter.media.contentTypes.items.properties.name.description": "メディアコンテンツのタイプ名",
|
||||
"setting.frontMatter.media.contentTypes.items.properties.fileTypes.description": "利用可能とするメディアコンテンツのタイプの指定",
|
||||
"setting.frontMatter.media.contentTypes.items.properties.fields.description": "メディアコンテンツのフィールドを設定します。",
|
||||
"setting.frontMatter.media.contentTypes.items.properties.fields.properties.title.description": "UI表示用のタイトル",
|
||||
"setting.frontMatter.media.contentTypes.items.properties.fields.properties.name.description": "フィールドの名前",
|
||||
"setting.frontMatter.media.contentTypes.items.properties.fields.properties.type.description": "フィールド値の型",
|
||||
"setting.frontMatter.media.contentTypes.items.properties.fields.properties.single.description": "単一行フィールド",
|
||||
|
||||
"setting.frontMatter.panel.freeform.markdownDescription": "未登録のタグ/カテゴリーをタグピッカーに入力可能にするかどうかを設定します(有効にすると、後で保存するオプションが使えます)。規定値はtrue。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.panel.freeform)",
|
||||
"setting.frontMatter.panel.actions.disabled.markdownDescription": "パネル内で非表示にしたいコマンドを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.panel.actions.disabled)",
|
||||
"setting.frontMatter.preview.host.markdownDescription": "プレビュー表示に使用するホストのURLを設定します(例:`http://localhost:1313`)。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.preview.host)",
|
||||
"setting.frontMatter.preview.trailingSlash.markdownDescription": "プレビュー用URLに末尾のスラッシュを加えるかどうかを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.preview.trailingslash)",
|
||||
"setting.frontMatter.preview.pathName.markdownDescription": "ホストパスとスラッグの間に追加したいパスを設定します。例えば、パスに`yyyy/MM`などの日付を含めたい場合等に使えます。日付は記事の日付フィールドの値に基づいて生成されます。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.preview.pathname)",
|
||||
"setting.frontMatter.site.baseURL.markdownDescription": "ベースURLを設定します。これはSEOチェックに利用されます。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.site.baseurl)",
|
||||
"setting.frontMatter.taxonomy.alignFilename.markdownDescription": "ファイル生成時にファイル名をスラッグに合わせる[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.alignfilename)",
|
||||
"setting.frontMatter.taxonomy.alignFilename.markdownDescription": "ファイル生成時にファイル名をスラッグに合わせます。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.alignfilename)",
|
||||
"setting.frontMatter.taxonomy.categories.markdownDescription": "Front Matterで利用するカテゴリーを管理します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.categories)",
|
||||
"setting.frontMatter.taxonomy.commaSeparatedFields.markdownDescription": "カンマ区切りで配列を管理するフィールド名を設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.commaseparatedfields)",
|
||||
"setting.frontMatter.taxonomy.commaSeparatedFields.items.description": "コンマ区切りの配列として使用するフィールドの名前。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.markdownDescription": "記事・ページ・その他で利用したい記事タイプを設定します。front matterで正しく`type`が設定されていることを確認してください。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.contenttypes)",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.description": "Front Matterで使用するコンテンツタイプを定義します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.name.description": "フィールドの種類を定義する",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fileType.description": "作成するコンテンツの種類を指定します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.description": "コンテンツ タイプのフィールドを定義する",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.description": "Front Matterで使用するコンテンツタイプを定義します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.type.description": "フィールドの種類を定義する",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.description": "Front Matterで使用する記事タイプを定義します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.name.description": "フィールドの種類を定義します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fileType.description": "作成する記事タイプを指定します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.description": "記事タイプのフィールドを定義します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.description": "Front Matterで使用する記事タイプを定義します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.type.description": "フィールド値の型",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.name.description": "使用するフィールドの名前",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.title.description": "UI に表示するタイトル",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.description.description": "UI に表示する説明",
|
||||
@@ -173,13 +198,13 @@
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.choices.description": "選択肢を定義する",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.choices.items.properties.id.description": "選択肢 ID",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.choices.items.properties.title.description": "選択肢のタイトル",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.single.description": "単一行フィールドである",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.wysiwyg.description": "WYSIWYG フィールド (HTML 出力) である",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.single.description": "単一行フィールド",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.wysiwyg.description": "WYSIWYG フィールド (HTML 出力) ",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.multiple.description": "複数の値を選択できますか?",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.isPreviewImage.description": "画像フィールドをプレビューとして使用できるかどうかを指定します。コンテンツ タイプごとに使用できるプレビュー画像は 1 つだけです。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.isPreviewImage.description": "画像フィールドをプレビューとして使用できるかどうかを指定します。記事タイプごとに使用できるプレビュー画像は1つだけです。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.hidden.description": "メタデータ セクションからフィールドを非表示にしますか?",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.taxonomyId.description": "分類フィールドの ID。「タグ」または「カテゴリ」の値を含めることはできません。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.fileExtensions.description": "ファイル ピッカーで許可するファイル拡張子を指定する",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.taxonomyId.description": "分類フィールドのID。「タグ」または「カテゴリ」の値を含めることはできません。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.fileExtensions.description": "ファイルピッカーで許可するファイル拡張子を指定する",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.fieldGroup.description": "'frontMatter.taxonomy.fieldGroups' 設定で定義されているフィールドグループの ID",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.dataType.description": "'frontMatter.data.types' 設定で定義されているデータ型の ID",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.numberOptions.description": "数値フィールドのオプションを指定する",
|
||||
@@ -188,6 +213,7 @@
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.numberOptions.properties.max.description": "最大値",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.numberOptions.properties.step.description": "ステップ値",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.taxonomyLimit.description": "選択する分類の数を制限します。無制限を許可するには 0 に設定します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.singleValueAsString.description": "配列内の要素が1つだけの時、配列ではなく文字列として扱います。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.isPublishDate.description": "フィールドが公開日フィールドであるかどうかを指定します",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.isModifiedDate.description": "フィールドが変更日フィールドであるかどうかを指定します",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.dataFileId.description": "このフィールドに使用するデータファイルのIDを指定します",
|
||||
@@ -197,30 +223,33 @@
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.encodeEmoji.description": "フィールドが絵文字をエンコードするかどうかを指定します",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.dateFormat.description": "使用する日付形式を指定する",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.required.description": "フィールドが必須かどうかを指定します",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.contentTypeName.description": "コンテンツ タイプ名を指定して、contentRelationship フィールドのコンテンツをフィルター処理します",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.contentTypeName.description": "記事タイプを指定して、contentRelationship フィールドのコンテンツをフィルター処理します",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.contentTypeValue.description": "コンテンツリレーションシップフィールドに挿入する値を指定します",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.when.description": "フィールドを表示する条件を指定する",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.when.properties.fieldRef.description": "使用するフィールド ID",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.when.properties.operator.description": "使用する演算子",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.when.properties.value.description": "比較する値",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.when.properties.caseSensitive.description": "比較で大文字と小文字を区別するかどうかを指定します。デフォルト: 真",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.pageBundle.description": "新しいコンテンツを作成するときにフォルダーを作成するかどうかを指定します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.previewPath.description": "コンテンツ タイプのカスタム プレビュー パスを定義します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.template.description": "新しいコンテンツの作成に使用できるオプションのテンプレート。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.postScript.description": "新しいコンテンツの作成後に使用できるオプションのポストスクリプト。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.filePrefix.description": "ファイル名のプレフィックスを定義します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.defaultFileName.description": "新しいコンテンツを作成するときに使用する既定のファイル名。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.when.properties.caseSensitive.description": "比較で大文字と小文字を区別するかどうかを指定します。デフォルト: true",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.pageBundle.description": "新しい記事を作成するときにフォルダーを作成するかどうかを指定します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.previewPath.description": "記事タイプのカスタム プレビュー パスを定義します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.trailingSlash.description": "プレビュー用URLに末尾のスラッシュを加えるかどうかを設定します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.slugTemplate.description": "記事タイプのカスタムスラッグのテンプレートを設定します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.template.description": "新しい記事の作成に使用できるオプションのテンプレート。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.postScript.description": "新しい記事の作成後に使用できるオプションのポストスクリプト。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.filePrefix.description": "ファイル名の接頭辞を定義します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.defaultFileName.description": "新しい記事の作成時に使用する既定のファイル名。",
|
||||
"setting.frontMatter.taxonomy.customTaxonomy.markdownDescription": "カスタムタクソノミーのフィールドデータを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.tags)",
|
||||
"setting.frontMatter.taxonomy.customTaxonomy.items.properties.id.description": "分類フィールドの ID。「タグ」または「カテゴリ」の値を含めることはできません。",
|
||||
"setting.frontMatter.taxonomy.customTaxonomy.items.properties.options.description": "選択できるオプション。",
|
||||
"setting.frontMatter.taxonomy.dateField.markdownDescription": "この設定は、記事の公開日フィールドを定義するために使用されます。[ドキュメントをチェックイン](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.datefield)",
|
||||
"setting.frontMatter.taxonomy.dateField.markdownDescription": "この設定は、記事の公開日フィールドを定義するために使用されます。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.datefield)",
|
||||
"setting.frontMatter.taxonomy.dateFormat.markdownDescription": "記事の日付フォーマットを指定します。詳しくは[date-fns formatting](https://date-fns.org/v2.0.1/docs/format)を確認してください。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.dateformat)",
|
||||
"setting.frontMatter.taxonomy.fieldGroups.markdownDescription": "ブロックフィールドで使用したいフィールドグループを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.fieldgroups)",
|
||||
"setting.frontMatter.taxonomy.fieldGroups.items.properties.id.description": "フィールドグループの名前",
|
||||
"setting.frontMatter.taxonomy.fieldGroups.items.properties.labelField.description": "表示値として使用するフィールドの名前",
|
||||
"setting.frontMatter.taxonomy.frontMatterType.markdownDescription": "front matterの形式を設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.frontmattertype)",
|
||||
"setting.frontMatter.taxonomy.indentArrays.markdownDescription": "front matterメタデータが配列の場合はインデント(字下げ)させます。規定値はtrueです。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.indentarrays)",
|
||||
"setting.frontMatter.taxonomy.modifiedField.markdownDescription": "この設定は、記事の変更日フィールドを定義するために使用されます。[ドキュメントをチェックイン](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.modifiedfield)",
|
||||
"setting.frontMatter.taxonomy.modifiedField.markdownDescription": "この設定は、記事の変更日フィールドを定義するために使用されます。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.modifiedfield)",
|
||||
"setting.frontMatter.taxonomy.quoteStringValues.markdownDescription": "front matterの文字列の値をクォーテーションで囲みます。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.quotestringvalues)",
|
||||
"setting.frontMatter.taxonomy.noPropertyValueQuotes.markdownDescription": "引用符を付与しないメタデータを指定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.nopropertyvaluequotes)",
|
||||
"setting.frontMatter.taxonomy.noPropertyValueQuotes.items.description": "引用符を削除したいプロパティの名前。",
|
||||
"setting.frontMatter.taxonomy.seoContentLengh.markdownDescription": "最適な記事の長さを指定します。2021年のSEOでは、1,760語から2,400語の間が最も理想的とされています。(-1に設定するとオフになります。)[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.seocontentlengh)",
|
||||
@@ -231,20 +260,23 @@
|
||||
"setting.frontMatter.taxonomy.seoTitleLength.markdownDescription": "SEOに適したタイトルの文字数を設定します。(`-1`に設定するとオフになります。)[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.seotitlelength)",
|
||||
"setting.frontMatter.taxonomy.slugPrefix.markdownDescription": "スラッグに付与する接頭辞を設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.slugprefix)",
|
||||
"setting.frontMatter.taxonomy.slugSuffix.markdownDescription": "スラッグに付与する接尾辞を設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.slugsuffix)",
|
||||
"setting.frontMatter.taxonomy.slugTemplate.markdownDescription": "記事を作成する際のカスタムスラッグのテンプレートを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.slugtemplate)",
|
||||
"setting.frontMatter.taxonomy.tags.markdownDescription": "Front Matterで利用するタグを管理します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.tags)",
|
||||
"setting.frontMatter.telemetry.disable.markdownDescription": "利用状況の送信をオフにします。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.telemetry.disable)",
|
||||
"setting.frontMatter.templates.enabled.markdownDescription": "テンプレート機能を利用します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.templates.enabled)",
|
||||
"setting.frontMatter.templates.folder.markdownDescription": "テンプレートを保存するフォルダーを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.templates.folder)",
|
||||
"setting.frontMatter.templates.prefix.markdownDescription": "新しい記事の作成時、ファイル名に付与する接頭辞を設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.templates.prefix)",
|
||||
"setting.frontMatter.dashboard.mediaSnippet.deprecationMessage": "この設定は非推奨であり、次のメジャーバージョンで削除される予定です。メディア スニペットは 'frontMatter.content.snippet' 設定で定義してください。",
|
||||
"setting.frontMatter.taxonomy.dateField.deprecationMessage": "この設定は非推奨であり、次のメジャーバージョンで削除される予定です。代わりに、コンテンツ タイプの日付フィールドで新しい 'isPublishDate' 設定を使用してください。",
|
||||
"setting.frontMatter.taxonomy.modifiedField.deprecationMessage": "この設定は非推奨であり、次のメジャーバージョンで削除される予定です。代わりに、コンテンツ タイプの日付フィールドで新しい 'isModifiedDate' 設定を使用してください。",
|
||||
"setting.frontMatter.global.disabledNotifications.markdownDescription": "これは、Front Matter CMS で無効にできる通知タイプの配列です。[ドキュメントをチェックイン](https://frontmatter.codes/docs/settings/overview#frontmatter.global.disablednotifications)",
|
||||
"setting.frontMatter.taxonomy.dateField.deprecationMessage": "この設定は非推奨であり、次のメジャーバージョンで削除される予定です。代わりに、記事タイプの日付フィールドで新しい 'isPublishDate' 設定を使用してください。",
|
||||
"setting.frontMatter.taxonomy.modifiedField.deprecationMessage": "この設定は非推奨であり、次のメジャーバージョンで削除される予定です。代わりに、記事タイプの日付フィールドで新しい 'isModifiedDate' 設定を使用してください。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.customType.description": "使用するユーザー設定フィールド型の名前を指定します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.clearEmpty.description": "空の値をクリアするかどうかを指定します。",
|
||||
"setting.frontMatter.website.host.markdownDescription": "ウェブサイトのホスト URL を指定します。[ドキュメントをチェックイン](https://frontmatter.codes/docs/settings/overview#frontmatter.website.url)",
|
||||
"command.frontMatter.settings.refresh": "フロントマター設定の更新",
|
||||
"setting.frontMatter.config.dynamicFilePath.markdownDescription": "動的構成ファイルへのパスを指定します (例: [[ワークスペース]]/config.js)。[ドキュメントをチェックイン](https://frontmatter.codes/docs/settings/overview#frontmatter.config.dynamicfilepath)",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.disableCreation.description": "フォルダー内の新しいコンテンツの作成を無効にします。",
|
||||
"setting.frontMatter.custom.scripts.items.properties.contentTypes.description": "スクリプトを使用するコンテンツ タイプを定義します。何も定義されていない場合は、すべての型で使用できます。"
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.clearEmpty.description": "空の値をクリアするかどうかを指定します。",
|
||||
"setting.frontMatter.website.host.markdownDescription": "ウェブサイトのホストURLを指定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.website.url)",
|
||||
"command.frontMatter.settings.refresh": "Front Matterの設定の再読み込み",
|
||||
"setting.frontMatter.config.dynamicFilePath.markdownDescription": "動的構成ファイルへのパスを指定します (例: [[ワークスペース]]/config.js)。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.config.dynamicfilepath)",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.allowAsSubContent.description": "記事をサブコンテンツとして作成可能かどうかを設定します。",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.isSubContent.description": "記事をサブコンテンツとして作成するかどうかを設定します。",
|
||||
|
||||
"setting.frontMatter.git.disableOnBranches.markdownDescription": "Git Actionsを無効化したいブランチを設定します。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.git.disableonbranches)",
|
||||
"setting.frontMatter.git.requiresCommitMessage.markdownDescription": "特定のブランチを更新する場合にコミットメッセージを必須にします。[ドキュメントを確認](https://frontmatter.codes/docs/settings/overview#frontmatter.git.requirescommitmessage)"
|
||||
}
|
||||
193
package.nls.json
@@ -15,7 +15,7 @@
|
||||
"command.frontMatter.initTemplate": "Initialize the template folder",
|
||||
"command.frontMatter.createTemplate": "Create template from current file",
|
||||
"command.frontMatter.createCategory": "Create category",
|
||||
"command.frontMatter.createContent": "Create new content from defined content type or template",
|
||||
"command.frontMatter.createContent": "Create new content",
|
||||
"command.frontMatter.createTag": "Create tag",
|
||||
"command.frontMatter.diagnostics": "Diagnostic logging",
|
||||
"command.frontMatter.exportTaxonomy": "Export all tags & categories to your settings",
|
||||
@@ -38,6 +38,7 @@
|
||||
"command.frontMatter.markup.orderedlist": "Ordered list",
|
||||
"command.frontMatter.markup.options": "Other markup options",
|
||||
"command.frontMatter.preview": "Preview content",
|
||||
"command.frontMatter.docs": "Documentation",
|
||||
"command.frontMatter.chatbot": "Ask the Front Matter AI for help",
|
||||
"command.frontMatter.promoteSettings": "Promote settings from local to team level",
|
||||
"command.frontMatter.remap": "Remap or remove tag/category in all articles",
|
||||
@@ -48,51 +49,61 @@
|
||||
"command.frontMatter.markup.unorderedlist": "Unordered list",
|
||||
"command.frontMatter.git.sync": "Sync",
|
||||
"command.frontMatter.cache.clear": "Clear cache",
|
||||
"command.frontMatter.i18n.create": "Create new translation",
|
||||
"settings.configuration.title": "Front Matter: use frontmatter.json for shared team settings",
|
||||
"setting.frontMatter.projects.markdownDescription": "Specify the list of projects to load in the Front Matter CMS. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.projects)",
|
||||
"setting.frontMatter.projects.markdownDescription": "Specify the list of projects to load in the Front Matter CMS. [Local](https://file%2B.vscode-resource.vscode-cdn.net/Users/eliostruyf/nodejs/frontmatter-test-projects/astro-blog/test.html) - [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.projects) - [View in VS Code](vscode://simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.projects%22%5D)",
|
||||
"setting.frontMatter.projects.items.properties.name.markdownDescription": "Specify the name of the project.",
|
||||
"setting.frontMatter.projects.items.properties.default.markdownDescription": "Specify if this project is the default project to load.",
|
||||
"setting.frontMatter.sponsors.ai.enabled.markdownDescription": "Specify if you want to enable AI suggestions. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.sponsors.ai.enabled)",
|
||||
"setting.frontMatter.extensibility.scripts.markdownDescription": "Specify the list of scripts to load in the Front Matter CMS. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.extensibility.scripts)",
|
||||
"setting.frontMatter.experimental.markdownDescription": "Specify if you want to enable the experimental features. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.experimental)",
|
||||
"setting.frontMatter.extends.markdownDescription": "Specify the list of paths/URLs to extend the Front Matter CMS config. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.extends)",
|
||||
"setting.frontMatter.content.autoUpdateDate.markdownDescription": "Specify if you want to automatically update the modified date of your article/page (only content located in your content folder). [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.autoupdatedate)",
|
||||
"setting.frontMatter.content.defaultFileType.markdownDescription": "Specify the default file type for the content to create. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.defaultfiletype)",
|
||||
"setting.frontMatter.content.defaultSorting.markdownDescription": "Specify the default sorting option for the content dashboard. You can use one of the values from the enum or define your own ID. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.defaultsorting)",
|
||||
"setting.frontMatter.content.draftField.markdownDescription": "Define the draft field you want to use to manage your content. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.draftfield)",
|
||||
"setting.frontMatter.sponsors.ai.enabled.markdownDescription": "Specify if you want to enable AI suggestions. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.sponsors.ai.enabled) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.sponsors.ai.enabled%22%5D)",
|
||||
"setting.frontMatter.extensibility.scripts.markdownDescription": "Specify the list of scripts to load in the Front Matter CMS. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.extensibility.scripts) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.extensibility.scripts%22%5D)",
|
||||
"setting.frontMatter.experimental.markdownDescription": "Specify if you want to enable the experimental features. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.experimental) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.experimental%22%5D)",
|
||||
"setting.frontMatter.extends.markdownDescription": "Specify the list of paths/URLs to extend the Front Matter CMS config. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.extends) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.extends%22%5D)",
|
||||
"setting.frontMatter.content.autoUpdateDate.markdownDescription": "Specify if you want to automatically update the modified date of your article/page (only content located in your content folder). [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.autoupdatedate) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.content.autoupdatedate%22%5D)",
|
||||
"setting.frontMatter.content.defaultFileType.markdownDescription": "Specify the default file type for the content to create. [Docs](https://frontmatter.codes/docs/settings/overview%23frontmatter.content.defaultfiletype) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.content.defaultfiletype%22%5D)",
|
||||
"setting.frontMatter.content.defaultSorting.markdownDescription": "Specify the default sorting option for the content dashboard. You can use one of the values from the enum or define your own ID. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.defaultsorting) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.content.defaultsorting%22%5D)",
|
||||
"setting.frontMatter.content.draftField.markdownDescription": "Define the draft field you want to use to manage your content. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.draftfield) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.content.draftfield%22%5D)",
|
||||
"setting.frontMatter.content.draftField.properties.type.description": "Type of the draft field you want to use",
|
||||
"setting.frontMatter.content.draftField.properties.name.description": "Name of the field to use",
|
||||
"setting.frontMatter.content.draftField.properties.invert.description": "By default the draft field is set to true when the content is a draft. Set this to true to set it to false.",
|
||||
"setting.frontMatter.content.draftField.properties.choices.description": "List of choices for the field",
|
||||
"setting.frontMatter.content.fmHighlight.markdownDescription": "Specify if you want to highlight the Front Matter in the Markdown file. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.fmhighlight)",
|
||||
"setting.frontMatter.content.hideFm.markdownDescription": "Specify if you want to hide the Front Matter in the Markdown file. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.hidefm)",
|
||||
"setting.frontMatter.content.hideFmMessage.markdownDescription": "Specify the message to display when the Front Matter is hidden. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.hidefmMessage)",
|
||||
"setting.frontMatter.content.pageFolders.markdownDescription": "This array of folders defines where the extension can retrieve or create new pages. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.pagefolders)",
|
||||
"setting.frontMatter.content.fmHighlight.markdownDescription": "Specify if you want to highlight the Front Matter in the Markdown file. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.fmhighlight) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.content.fmhighlight%22%5D)",
|
||||
"setting.frontMatter.content.hideFm.markdownDescription": "Specify if you want to hide the Front Matter in the Markdown file. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.hidefm) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.content.hidefm%22%5D)",
|
||||
"setting.frontMatter.content.hideFmMessage.markdownDescription": "Specify the message to display when the Front Matter is hidden. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.hidefmMessage) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.content.hidefmMessage%22%5D)",
|
||||
"setting.frontMatter.content.pageFolders.markdownDescription": "This array of folders defines where the extension can retrieve or create new pages. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.pagefolders) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.content.pagefolders%22%5D)",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.title.description": "Name of the folder",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.path.description": "Path of the folder",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.excludeSubdir.description": "Exclude sub-directories",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.previewPath.description": "Defines a custom preview path for the folder.",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.trailingSlash.description": "Specify if you want to add a trailing slash to the preview URL.",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.filePrefix.description": "Defines a prefix for the file name.",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.contentTypes.description": "Defines which content types can be used for the current location. If not defined, all content types will be available.",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.disableCreation.description": "Disable the creation of new content in the folder.",
|
||||
"setting.frontMatter.content.placeholders.markdownDescription": "This array of placeholders defines the placeholders that you can use in your content types and templates for automatically populating your content its front matter. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.placeholders)",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.defaultLocale.description": "Set the default locale ID for the page folder. All content from this folder is translatable to the languages defined in the `frontMatter.content.i18n` setting.",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.locales.description": "Define the locales for the page folder. This will be used for the translation of the content.",
|
||||
"setting.frontMatter.content.pageFolders.items.properties.slugTemplate.description": "Defines a custom slug template.",
|
||||
"setting.frontMatter.content.i18n.markdownDescription": "Specify the locales you want to use for your website. This setting can be overwritten on page folder level. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.i18n) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.content.i18n%22%5D)",
|
||||
"setting.frontMatter.content.i18n.items.properties.title.description": "Title of the locale",
|
||||
"setting.frontMatter.content.i18n.items.properties.locale.description": "Locale code",
|
||||
"setting.frontMatter.content.i18n.items.properties.path.description": "Relative path of the locale folder",
|
||||
"setting.frontMatter.content.placeholders.markdownDescription": "This array of placeholders defines the placeholders that you can use in your content types and templates for automatically populating your content its front matter. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.placeholders) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.content.placeholders%22%5D)",
|
||||
"setting.frontMatter.content.placeholders.items.properties.id.description": "ID of the placeholder, in your content type or template, use it as follows: {{placeholder}}",
|
||||
"setting.frontMatter.content.placeholders.items.properties.value.description": "The placeholder its value",
|
||||
"setting.frontMatter.content.placeholders.items.properties.script.description": "The script to execute to get the value of the placeholder",
|
||||
"setting.frontMatter.content.publicFolder.markdownDescription": "Specify the folder name where all your assets are located. For instance in Hugo this is the `static` folder. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.publicfolder)",
|
||||
"setting.frontMatter.content.publicFolder.markdownDescription": "Specify the folder name where all your assets are located. For instance in Hugo this is the `static` folder. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.publicfolder) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.content.publicfolder%22%5D)",
|
||||
"setting.frontMatter.content.publicFolder.properties.path.description": "Specify the path of the assets folder",
|
||||
"setting.frontMatter.content.publicFolder.properties.relative.description": "Defines if the path to your media files be relative to the content file?",
|
||||
"setting.frontMatter.snippets.wrapper.enabled.markdownDescription": "Specify if you want to wrap the snippets. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontMatter.snippets.wrapper.enabled)",
|
||||
"setting.frontMatter.content.snippets.markdownDescription": "Define the snippets you want to use in your content. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.snippets)",
|
||||
"setting.frontMatter.content.sorting.markdownDescription": "Define the sorting options for your dashboard content. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.sorting)",
|
||||
"setting.frontMatter.snippets.wrapper.enabled.markdownDescription": "Specify if you want to wrap the snippets. [Docs](https://frontmatter.codes/docs/settings/overview#frontMatter.snippets.wrapper.enabled) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontMatter.snippets.wrapper.enabled%22%5D)",
|
||||
"setting.frontMatter.content.snippets.markdownDescription": "Define the snippets you want to use in your content. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.snippets) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.content.snippets%22%5D)",
|
||||
"setting.frontMatter.content.sorting.markdownDescription": "Define the sorting options for your dashboard content. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.sorting) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.content.sorting%22%5D)",
|
||||
"setting.frontMatter.content.sorting.items.properties.id.description": "The ID of the sorting option. This will be used for the storing the last used sorting option or the default option.",
|
||||
"setting.frontMatter.content.sorting.items.properties.title.description": "Name of the sorting label",
|
||||
"setting.frontMatter.content.sorting.items.properties.name.description": "Name of the metadata field to sort by",
|
||||
"setting.frontMatter.content.sorting.items.properties.order.description": "Order of the sorting",
|
||||
"setting.frontMatter.content.sorting.items.properties.type.description": "Type of the field value",
|
||||
"setting.frontMatter.content.supportedFileTypes.markdownDescription": "Specify the file types that you want to use in Front Matter. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.supportedfiletypes)",
|
||||
"setting.frontMatter.content.wysiwyg.markdownDescription": "Specifies if you want to enable/disable the What You See, Is What You Get (WYSIWYG) markdown controls. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.wysiwyg)",
|
||||
"setting.frontMatter.custom.scripts.markdownDescription": "Specify the path to a Node.js script to execute. The current file path will be provided as an argument. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.custom.scripts)",
|
||||
"setting.frontMatter.content.supportedFileTypes.markdownDescription": "Specify the file types that you want to use in Front Matter. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.supportedfiletypes) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.content.supportedfiletypes%22%5D)",
|
||||
"setting.frontMatter.content.wysiwyg.markdownDescription": "Specifies if you want to enable/disable the What You See, Is What You Get (WYSIWYG) markdown controls. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.wysiwyg) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.content.wysiwyg%22%5D)",
|
||||
"setting.frontMatter.content.filters.markdownDescription": "Specify the filters you want to use for your content dashboard. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.content.filters) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.content.filters%22%5D)",
|
||||
"setting.frontMatter.custom.scripts.markdownDescription": "Specify the path to a Node.js script to execute. The current file path will be provided as an argument. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.custom.scripts) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.custom.scripts%22%5D)",
|
||||
"setting.frontMatter.custom.scripts.items.properties.id.description": "ID of the script.",
|
||||
"setting.frontMatter.custom.scripts.items.properties.title.description": "Title you want to give to your script. Will be shown as the title of the button.",
|
||||
"setting.frontMatter.custom.scripts.items.properties.script.description": "Path to the script to execute",
|
||||
@@ -106,16 +117,16 @@
|
||||
"setting.frontMatter.custom.scripts.items.properties.environments.items.properties.type.description": "The environment type for which the script needs to be used",
|
||||
"setting.frontMatter.custom.scripts.items.properties.environments.items.properties.script.description": "Path to the script to execute",
|
||||
"setting.frontMatter.custom.scripts.items.properties.contentTypes.description": "Define the content types for which the script will be used. If none are defined, it will be available to all types.",
|
||||
"setting.frontMatter.dashboard.content.pagination.markdownDescription": "Specify if you want to enable/disable pagination for your content. You can define your page number up to 52. Default items per page is `16`. Disabling the pagination can be done by setting it to `false`. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.dashboard.content.pagination)",
|
||||
"setting.frontMatter.dashboard.content.cardTags.markdownDescription": "Specify the name of the metadata field that will be used to show the tags on the content card. When empty or null, it will hide the tags from the card. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.dashboard.content.cardtags)",
|
||||
"setting.frontMatter.dashboard.content.card.fields.state.markdownDescription": "Specify if you want to show the state/draft status on the content card view. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontMatter.dashboard.content.card.fields.state)",
|
||||
"setting.frontMatter.dashboard.content.card.fields.date.markdownDescription": "Specify if you want to show the date on the content card view. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontMatter.dashboard.content.card.fields.date)",
|
||||
"setting.frontMatter.dashboard.content.card.fields.description.markdownDescription": "Specify the name of the metadata field that will be used to show the description on the content card. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontMatter.dashboard.content.card.fields.description)",
|
||||
"setting.frontMatter.dashboard.content.card.fields.title.markdownDescription": "Specify the name of the metadata field that will be used to show the title on the content card. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontMatter.dashboard.content.card.fields.title)",
|
||||
"setting.frontMatter.dashboard.mediaSnippet.markdownDescription": "Specify the a snippet for your custom media insert markup. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.dashboard.mediasnippet)",
|
||||
"setting.frontMatter.dashboard.content.pagination.markdownDescription": "Specify if you want to enable/disable pagination for your content. You can define your page number up to 52. Default items per page is `16`. Disabling the pagination can be done by setting it to `false`. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.dashboard.content.pagination) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.dashboard.content.pagination%22%5D)",
|
||||
"setting.frontMatter.dashboard.content.cardTags.markdownDescription": "Specify the name of the metadata field that will be used to show the tags on the content card. When empty or null, it will hide the tags from the card. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.dashboard.content.cardtags) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.dashboard.content.cardtags%22%5D)",
|
||||
"setting.frontMatter.dashboard.content.card.fields.state.markdownDescription": "Specify if you want to show the state/draft status on the content card view. [Docs](https://frontmatter.codes/docs/settings/overview#frontMatter.dashboard.content.card.fields.state) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontMatter.dashboard.content.card.fields.state%22%5D)",
|
||||
"setting.frontMatter.dashboard.content.card.fields.date.markdownDescription": "Specify if you want to show the date on the content card view. [Docs](https://frontmatter.codes/docs/settings/overview#frontMatter.dashboard.content.card.fields.date) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontMatter.dashboard.content.card.fields.date%22%5D)",
|
||||
"setting.frontMatter.dashboard.content.card.fields.description.markdownDescription": "Specify the name of the metadata field that will be used to show the description on the content card. [Docs](https://frontmatter.codes/docs/settings/overview#frontMatter.dashboard.content.card.fields.description) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontMatter.dashboard.content.card.fields.description%22%5D)",
|
||||
"setting.frontMatter.dashboard.content.card.fields.title.markdownDescription": "Specify the name of the metadata field that will be used to show the title on the content card. [Docs](https://frontmatter.codes/docs/settings/overview#frontMatter.dashboard.content.card.fields.title) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontMatter.dashboard.content.card.fields.title%22%5D)",
|
||||
"setting.frontMatter.dashboard.mediaSnippet.markdownDescription": "Specify the a snippet for your custom media insert markup. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.dashboard.mediasnippet) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.dashboard.mediasnippet%22%5D)",
|
||||
"setting.frontMatter.dashboard.mediaSnippet.items.description": "Use the `{mediaUrl}`, `{caption}`, `{alt}`, `{filename}`, `{mediaHeight}`, and `{mediaWidth}` placeholders in your snippet to automatically insert the media information.",
|
||||
"setting.frontMatter.dashboard.openOnStart.markdownDescription": "Specify if you want to open the dashboard when you start VS Code. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.dashboard.openonstart)",
|
||||
"setting.frontMatter.data.files.markdownDescription": "Specify the data files you want to use for your website. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.data.files)",
|
||||
"setting.frontMatter.dashboard.openOnStart.markdownDescription": "Specify if you want to open the dashboard when you start VS Code. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.dashboard.openonstart) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.dashboard.openonstart%22%5D)",
|
||||
"setting.frontMatter.data.files.markdownDescription": "Specify the data files you want to use for your website. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.data.files) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.data.files%22%5D)",
|
||||
"setting.frontMatter.data.files.items.properties.id.description": "Your unique ID you want to use for your data file.",
|
||||
"setting.frontMatter.data.files.items.properties.title.description": "Title you want to give to your data file.",
|
||||
"setting.frontMatter.data.files.items.properties.labelField.description": "The field you want to use as label for your data entries.",
|
||||
@@ -128,41 +139,53 @@
|
||||
"setting.frontMatter.data.files.items.properties.schema.properties.properties.description": "Defines the fields of the form.",
|
||||
"setting.frontMatter.data.files.items.properties.type.description": "If you are using data types, you can specify your type ID.",
|
||||
"setting.frontMatter.data.files.items.properties.singleEntry.description": "If you want to use a single entry for your data file.",
|
||||
"setting.frontMatter.data.folders.markdownDescription": "Specify the data folders you want to use for your website. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.data.folders)",
|
||||
"setting.frontMatter.data.folders.markdownDescription": "Specify the data folders you want to use for your website. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.data.folders) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.data.folders%22%5D)",
|
||||
"setting.frontMatter.data.folders.items.properties.id.description": "Your unique ID you want to use for your data folder.",
|
||||
"setting.frontMatter.data.folders.items.properties.labelField.description": "The field you want to use as label for your data entries.",
|
||||
"setting.frontMatter.data.folders.items.properties.path.description": "Path to the folder to load files.",
|
||||
"setting.frontMatter.data.folders.items.properties.type.description": "If you are using data types, you can specify your type ID.",
|
||||
"setting.frontMatter.data.folders.items.properties.singleEntry.description": "If you want to use a single entry for your data files in the folder.",
|
||||
"setting.frontMatter.data.types.markdownDescription": "Specify the data types. These types can be used in for your data files. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.data.types)",
|
||||
"setting.frontMatter.data.types.markdownDescription": "Specify the data types. These types can be used in for your data files. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.data.types) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.data.types%22%5D)",
|
||||
"setting.frontMatter.data.types.items.properties.id.description": "Your unique ID you want to use for your data type.",
|
||||
"setting.frontMatter.file.preserveCasing.markdownDescription": "Specify if you want to preserve the casing of your file names from the title. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.file.preservecasing)",
|
||||
"setting.frontMatter.framework.id.markdownDescription": "Specify the ID of your static site generator or framework you are using for your website. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.framework.id)",
|
||||
"setting.frontMatter.framework.startCommand.markdownDescription": "Specify the command you want to use to start your static site generator or framework. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.framework.startcommand)",
|
||||
"setting.frontMatter.git.enabled.markdownDescription": "Specify if you want to use the Git actions for your website. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.git.enabled)",
|
||||
"setting.frontMatter.git.commitMessage.markdownDescription": "Specify the commit message you want to use for the sync. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.git.commitmessage)",
|
||||
"setting.frontMatter.git.submodule.pull.markdownDescription": "Specify if you want to pull submodules when syncing. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.git.submodule.pull)",
|
||||
"setting.frontMatter.git.submodule.push.markdownDescription": "Specify if you want to push submodules when syncing. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.git.submodule.push)",
|
||||
"setting.frontMatter.git.submodule.branch.markdownDescription": "Specify the submodule branch to checkout. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.git.submodule.branch)",
|
||||
"setting.frontMatter.git.submodule.folder.markdownDescription": "Specify the submodule folder of your content, this can be handy when you are using multiple submodules. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.git.submodule.folder)",
|
||||
"setting.frontMatter.global.activeMode.markdownDescription": "Specify the activated mode of Front Matter. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.global.activemode)",
|
||||
"setting.frontMatter.global.modes.markdownDescription": "Specify the modes you want to use for Front Matter. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.global.modes)",
|
||||
"setting.frontMatter.file.preserveCasing.markdownDescription": "Specify if you want to preserve the casing of your file names from the title. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.file.preservecasing) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.file.preservecasing%22%5D)",
|
||||
"setting.frontMatter.framework.id.markdownDescription": "Specify the ID of your static site generator or framework you are using for your website. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.framework.id) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.framework.id%22%5D)",
|
||||
"setting.frontMatter.framework.startCommand.markdownDescription": "Specify the command you want to use to start your static site generator or framework. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.framework.startcommand) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.framework.startcommand%22%5D)",
|
||||
"setting.frontMatter.git.enabled.markdownDescription": "Specify if you want to use the Git actions for your website. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.git.enabled) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.git.enabled%22%5D)",
|
||||
"setting.frontMatter.git.commitMessage.markdownDescription": "Specify the commit message you want to use for the sync. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.git.commitmessage) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.git.commitmessage%22%5D)",
|
||||
"setting.frontMatter.git.submodule.pull.markdownDescription": "Specify if you want to pull submodules when syncing. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.git.submodule.pull) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.git.submodule.pull%22%5D)",
|
||||
"setting.frontMatter.git.submodule.push.markdownDescription": "Specify if you want to push submodules when syncing. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.git.submodule.push) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.git.submodule.push%22%5D)",
|
||||
"setting.frontMatter.git.submodule.branch.markdownDescription": "Specify the submodule branch to checkout. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.git.submodule.branch) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.git.submodule.branch%22%5D)",
|
||||
"setting.frontMatter.git.submodule.folder.markdownDescription": "Specify the submodule folder of your content, this can be handy when you are using multiple submodules. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.git.submodule.folder) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.git.submodule.folder%22%5D)",
|
||||
"setting.frontMatter.global.activeMode.markdownDescription": "Specify the activated mode of Front Matter. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.global.activemode) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.global.activemode%22%5D)",
|
||||
"setting.frontMatter.global.modes.markdownDescription": "Specify the modes you want to use for Front Matter. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.global.modes) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.global.modes%22%5D)",
|
||||
"setting.frontMatter.global.modes.items.properties.id.description": "The ID of your mode.",
|
||||
"setting.frontMatter.global.modes.items.properties.features.description": "The features you want to use for your mode.",
|
||||
"setting.frontMatter.global.notifications.markdownDescription": "Specifies the notifications you want to see. By default, all notifications types will be shown. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.global.notifications)",
|
||||
"setting.frontMatter.global.disabledNotifications.markdownDescription": "This is an array with the notifications types that can be disabled for Front Matter CMS. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.global.disablednotifications)",
|
||||
"setting.frontMatter.media.defaultSorting.markdownDescription": "Specify the default sorting option for the media dashboard. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.media.defaultsorting)",
|
||||
"setting.frontMatter.media.supportedMimeTypes.markdownDescription": "Specify the mime types to support for the media files. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.media.supportedmimetypes)",
|
||||
"setting.frontMatter.panel.freeform.markdownDescription": "Specifies if you want to allow yourself from entering unknown tags/categories in the tag picker (when enabled, you will have the option to store them afterwards). Default: true. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.panel.freeform)",
|
||||
"setting.frontMatter.panel.actions.disabled.markdownDescription": "Specify the actions you want to disable in the panel. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.panel.actions.disabled)",
|
||||
"setting.frontMatter.preview.host.markdownDescription": "Specify the host URL (example: http://localhost:1313) to be used when opening the preview. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.preview.host)",
|
||||
"setting.frontMatter.preview.pathName.markdownDescription": "Specify the path you want to add after the host and before your slug. This can be used for instance to include the year/month like: `yyyy/MM`. The date will be generated based on the article its date field value. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.preview.pathname)",
|
||||
"setting.frontMatter.site.baseURL.markdownDescription": "Specify the base URL of your site, this will be used for SEO checks. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.site.baseurl)",
|
||||
"setting.frontMatter.taxonomy.alignFilename.markdownDescription": "Align the filename with the new slug when it gets generated. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.alignfilename)",
|
||||
"setting.frontMatter.taxonomy.categories.markdownDescription": "Specifies the categories which can be used in the Front Matter. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.categories)",
|
||||
"setting.frontMatter.taxonomy.commaSeparatedFields.markdownDescription": "Specify the fields names that Front Matter should treat as a comma-separated array. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.commaseparatedfields)",
|
||||
"setting.frontMatter.global.notifications.markdownDescription": "Specifies the notifications you want to see. By default, all notifications types will be shown. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.global.notifications) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.global.notifications%22%5D)",
|
||||
"setting.frontMatter.global.disabledNotifications.markdownDescription": "This is an array with the notifications types that can be disabled for Front Matter CMS. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.global.disablednotifications) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.global.disablednotifications%22%5D)",
|
||||
"setting.frontMatter.media.defaultSorting.markdownDescription": "Specify the default sorting option for the media dashboard. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.media.defaultsorting) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.media.defaultsorting%22%5D)",
|
||||
"setting.frontMatter.media.supportedMimeTypes.markdownDescription": "Specify the mime types to support for the media files. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.media.supportedmimetypes) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.media.supportedmimetypes%22%5D)",
|
||||
|
||||
"setting.frontMatter.media.contentTypes.markdownDescription": "Specify the media content types you want to use in Front Matter. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.media.contenttypes) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.media.contenttypes%22%5D)",
|
||||
"setting.frontMatter.media.contentTypes.items.description": "Define the media content types you want to use in Front Matter.",
|
||||
"setting.frontMatter.media.contentTypes.items.properties.name.description": "Name of the media content type",
|
||||
"setting.frontMatter.media.contentTypes.items.properties.fileTypes.description": "Specify the file types to allow for the media content type",
|
||||
"setting.frontMatter.media.contentTypes.items.properties.fields.description": "Define the fields of the media content type",
|
||||
"setting.frontMatter.media.contentTypes.items.properties.fields.properties.title.description": "Title to show in the UI",
|
||||
"setting.frontMatter.media.contentTypes.items.properties.fields.properties.name.description": "Name of the field to use",
|
||||
"setting.frontMatter.media.contentTypes.items.properties.fields.properties.type.description": "Define the type of field",
|
||||
"setting.frontMatter.media.contentTypes.items.properties.fields.properties.single.description": "Is a single line field",
|
||||
|
||||
"setting.frontMatter.panel.freeform.markdownDescription": "Specifies if you want to allow yourself from entering unknown tags/categories in the tag picker (when enabled, you will have the option to store them afterwards). Default: true. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.panel.freeform) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.panel.freeform%22%5D)",
|
||||
"setting.frontMatter.panel.actions.disabled.markdownDescription": "Specify the actions you want to disable in the panel. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.panel.actions.disabled) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.panel.actions.disabled%22%5D)",
|
||||
"setting.frontMatter.preview.host.markdownDescription": "Specify the host URL (example: http://localhost:1313) to be used when opening the preview. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.preview.host) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.preview.host%22%5D)",
|
||||
"setting.frontMatter.preview.trailingSlash.markdownDescription": "Specify if you want to add a trailing slash to the preview URL. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.preview.trailingslash) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.preview.trailingslash%22%5D)",
|
||||
"setting.frontMatter.preview.pathName.markdownDescription": "Specify the path you want to add after the host and before your slug. This can be used for instance to include the year/month like: `yyyy/MM`. The date will be generated based on the article its date field value. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.preview.pathname) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.preview.pathname%22%5D)",
|
||||
"setting.frontMatter.site.baseURL.markdownDescription": "Specify the base URL of your site, this will be used for SEO checks. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.site.baseurl) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.site.baseurl%22%5D)",
|
||||
"setting.frontMatter.taxonomy.alignFilename.markdownDescription": "Align the filename with the new slug when it gets generated. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.alignfilename) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.alignfilename%22%5D)",
|
||||
"setting.frontMatter.taxonomy.categories.markdownDescription": "Specifies the categories which can be used in the Front Matter. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.categories) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.categories%22%5D)",
|
||||
"setting.frontMatter.taxonomy.commaSeparatedFields.markdownDescription": "Specify the fields names that Front Matter should treat as a comma-separated array. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.commaseparatedfields) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.commaseparatedfields%22%5D)",
|
||||
"setting.frontMatter.taxonomy.commaSeparatedFields.items.description": "Name of the fields you want to use as comma-separated arrays.",
|
||||
"setting.frontMatter.taxonomy.contentTypes.markdownDescription": "Specify the type of contents you want to use for your articles/pages/etc. Make sure the `type` is correctly set in your front matter. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.contenttypes)",
|
||||
"setting.frontMatter.taxonomy.contentTypes.markdownDescription": "Specify the type of contents you want to use for your articles/pages/etc. Make sure the `type` is correctly set in your front matter. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.contenttypes) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.contenttypes%22%5D)",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.description": "Define the content types you want to use in Front Matter.",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.name.description": "Define the type of field",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fileType.description": "Specifies the type of content you want to create.",
|
||||
@@ -210,45 +233,51 @@
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.when.properties.caseSensitive.description": "Specify if the comparison is case sensitive. Default: true",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.pageBundle.description": "Specify if you want to create a folder when creating new content.",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.previewPath.description": "Defines a custom preview path for the content type.",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.trailingSlash.description": "Specify if you want to add a trailing slash to the preview URL.",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.slugTemplate.description": "Defines a custom slug template for the content type.",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.template.description": "An optional template that can be used for creating new content.",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.postScript.description": "An optional post script that can be used after new content creation.",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.filePrefix.description": "Defines a prefix for the file name.",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.defaultFileName.description": "Default file name to use when creating new content.",
|
||||
"setting.frontMatter.taxonomy.customTaxonomy.markdownDescription": "Specify the custom taxonomy field data. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.tags)",
|
||||
"setting.frontMatter.taxonomy.customTaxonomy.markdownDescription": "Specify the custom taxonomy field data. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.tags) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.tags%22%5D)",
|
||||
"setting.frontMatter.taxonomy.customTaxonomy.items.properties.id.description": "ID for your taxonomy field. It cannot contain the \"tags\" or \"categories\" value.",
|
||||
"setting.frontMatter.taxonomy.customTaxonomy.items.properties.options.description": "Options from which you can pick.",
|
||||
"setting.frontMatter.taxonomy.dateField.markdownDescription": "This setting is used to define the publishing date field of your articles. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.datefield)",
|
||||
"setting.frontMatter.taxonomy.dateFormat.markdownDescription": "Specify the date format for your articles. Check [date-fns formating](https://date-fns.org/v2.0.1/docs/format) for more information. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.dateformat)",
|
||||
"setting.frontMatter.taxonomy.fieldGroups.markdownDescription": "Define the field groups you want to use for your block fields or collection fields. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.fieldgroups)",
|
||||
"setting.frontMatter.taxonomy.dateField.markdownDescription": "This setting is used to define the publishing date field of your articles. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.datefield) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.datefield%22%5D)",
|
||||
"setting.frontMatter.taxonomy.dateFormat.markdownDescription": "Specify the date format for your articles. Check [date-fns formating](https://date-fns.org/v2.0.1/docs/format) for more information. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.dateformat) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.dateformat%22%5D)",
|
||||
"setting.frontMatter.taxonomy.fieldGroups.markdownDescription": "Define the field groups you want to use for your block fields or collection fields. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.fieldgroups) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.fieldgroups%22%5D)",
|
||||
"setting.frontMatter.taxonomy.fieldGroups.items.properties.id.description": "The name of the field group",
|
||||
"setting.frontMatter.taxonomy.fieldGroups.items.properties.labelField.description": "The name of the field to be used as display value",
|
||||
"setting.frontMatter.taxonomy.frontMatterType.markdownDescription": "Specify the type of Front Matter to use. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.frontmattertype)",
|
||||
"setting.frontMatter.taxonomy.indentArrays.markdownDescription": "Specify if arrays in front matter are indented. Default: true. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.indentarrays)",
|
||||
"setting.frontMatter.taxonomy.modifiedField.markdownDescription": "This setting is used to define the modified date field of your articles. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.modifiedfield)",
|
||||
"setting.frontMatter.taxonomy.quoteStringValues.markdownDescription": "Specify if you want to quote string values in the front matter. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.quotestringvalues)",
|
||||
"setting.frontMatter.taxonomy.noPropertyValueQuotes.markdownDescription": "Specify the properties from which quotes need to be removed. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.nopropertyvaluequotes)",
|
||||
"setting.frontMatter.taxonomy.frontMatterType.markdownDescription": "Specify the type of Front Matter to use. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.frontmattertype) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.frontmattertype%22%5D)",
|
||||
"setting.frontMatter.taxonomy.indentArrays.markdownDescription": "Specify if arrays in front matter are indented. Default: true. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.indentarrays) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.indentarrays%22%5D)",
|
||||
"setting.frontMatter.taxonomy.modifiedField.markdownDescription": "This setting is used to define the modified date field of your articles. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.modifiedfield) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.modifiedfield%22%5D)",
|
||||
"setting.frontMatter.taxonomy.quoteStringValues.markdownDescription": "Specify if you want to quote string values in the front matter. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.quotestringvalues) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.quotestringvalues%22%5D)",
|
||||
"setting.frontMatter.taxonomy.noPropertyValueQuotes.markdownDescription": "Specify the properties from which quotes need to be removed. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.nopropertyvaluequotes) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.nopropertyvaluequotes%22%5D)",
|
||||
"setting.frontMatter.taxonomy.noPropertyValueQuotes.items.description": "Name of the properties you want to remove quotes from.",
|
||||
"setting.frontMatter.taxonomy.seoContentLengh.markdownDescription": "Specifies the optimal minimum length for your articles. Between 1,760 words – 2,400 is the absolute ideal article length for SEO in 2021. (set to `-1` to turn it off). [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.seocontentlengh)",
|
||||
"setting.frontMatter.taxonomy.seoDescriptionField.markdownDescription": "Specifies the name of the SEO description field for your page. Default is 'description'. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.seodescriptionfield)",
|
||||
"setting.frontMatter.taxonomy.seoDescriptionLength.markdownDescription": "Specifies the optimal description length for SEO (set to `-1` to turn it off). [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.seodescriptionlength)",
|
||||
"setting.frontMatter.taxonomy.seoSlugLength.markdownDescription": "Specifies the optimal slug length for SEO (set to `-1` to turn it off). [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.seosluglength)",
|
||||
"setting.frontMatter.taxonomy.seoTitleField.markdownDescription": "Specifies the name of the SEO title field for your page. Default is 'title'. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.seotitlefield)",
|
||||
"setting.frontMatter.taxonomy.seoTitleLength.markdownDescription": "Specifies the optimal title length for SEO (set to `-1` to turn it off). [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.seotitlelength)",
|
||||
"setting.frontMatter.taxonomy.slugPrefix.markdownDescription": "Specify a prefix for the slug. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.slugprefix)",
|
||||
"setting.frontMatter.taxonomy.slugSuffix.markdownDescription": "Specify a suffix for the slug. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.slugsuffix)",
|
||||
"setting.frontMatter.taxonomy.tags.markdownDescription": "Specifies the tags which can be used in the Front Matter. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.tags)",
|
||||
"setting.frontMatter.telemetry.disable.markdownDescription": "Specify if you want to disable the telemetry. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.telemetry.disable)",
|
||||
"setting.frontMatter.templates.enabled.markdownDescription": "Specify if you want to use templates. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.templates.enabled)",
|
||||
"setting.frontMatter.templates.folder.markdownDescription": "Specify the folder to use for your article templates. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.templates.folder)",
|
||||
"setting.frontMatter.templates.prefix.markdownDescription": "Specify the prefix you want to add for your new article filenames. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.templates.prefix)",
|
||||
"setting.frontMatter.taxonomy.seoContentLengh.markdownDescription": "Specifies the optimal minimum length for your articles. Between 1,760 words – 2,400 is the absolute ideal article length for SEO in 2021. (set to `-1` to turn it off). [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.seocontentlengh) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.seocontentlengh%22%5D)",
|
||||
"setting.frontMatter.taxonomy.seoDescriptionField.markdownDescription": "Specifies the name of the SEO description field for your page. Default is 'description'. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.seodescriptionfield) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.seodescriptionfield%22%5D)",
|
||||
"setting.frontMatter.taxonomy.seoDescriptionLength.markdownDescription": "Specifies the optimal description length for SEO (set to `-1` to turn it off). [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.seodescriptionlength) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.seodescriptionlength%22%5D)",
|
||||
"setting.frontMatter.taxonomy.seoSlugLength.markdownDescription": "Specifies the optimal slug length for SEO (set to `-1` to turn it off). [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.seosluglength) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.seosluglength%22%5D)",
|
||||
"setting.frontMatter.taxonomy.seoTitleField.markdownDescription": "Specifies the name of the SEO title field for your page. Default is 'title'. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.seotitlefield) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.seotitlefield%22%5D)",
|
||||
"setting.frontMatter.taxonomy.seoTitleLength.markdownDescription": "Specifies the optimal title length for SEO (set to `-1` to turn it off). [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.seotitlelength) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.seotitlelength%22%5D)",
|
||||
"setting.frontMatter.taxonomy.slugPrefix.markdownDescription": "Specify a prefix for the slug. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.slugprefix) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.slugprefix%22%5D)",
|
||||
"setting.frontMatter.taxonomy.slugSuffix.markdownDescription": "Specify a suffix for the slug. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.slugsuffix) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.slugsuffix%22%5D)",
|
||||
"setting.frontMatter.taxonomy.slugTemplate.markdownDescription": "Defines a custom slug template for the content you will create. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.slugtemplate) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.slugtemplate%22%5D)",
|
||||
"setting.frontMatter.taxonomy.tags.markdownDescription": "Specifies the tags which can be used in the Front Matter. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.tags) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.taxonomy.tags%22%5D)",
|
||||
"setting.frontMatter.telemetry.disable.markdownDescription": "Specify if you want to disable the telemetry. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.telemetry.disable) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.telemetry.disable%22%5D)",
|
||||
"setting.frontMatter.templates.enabled.markdownDescription": "Specify if you want to use templates. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.templates.enabled) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.templates.enabled%22%5D)",
|
||||
"setting.frontMatter.templates.folder.markdownDescription": "Specify the folder to use for your article templates. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.templates.folder) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.templates.folder%22%5D)",
|
||||
"setting.frontMatter.templates.prefix.markdownDescription": "Specify the prefix you want to add for your new article filenames. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.templates.prefix) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.templates.prefix%22%5D)",
|
||||
"setting.frontMatter.dashboard.mediaSnippet.deprecationMessage": "This setting is deprecated and will be removed in the next major version. Please define your media snippet in the `frontMatter.content.snippet` setting.",
|
||||
"setting.frontMatter.taxonomy.dateField.deprecationMessage": "This setting is deprecated and will be removed in the next major version. Please use the new `isPublishDate` settings instead in your content types date fields.",
|
||||
"setting.frontMatter.taxonomy.modifiedField.deprecationMessage": "This setting is deprecated and will be removed in the next major version. Please use the new `isModifiedDate` settings instead in your content types date fields.",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.fields.items.properties.customType.description": "Specify the name of the custom field type to use.",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.clearEmpty.description": "Specify if the empty values should be cleared.",
|
||||
"setting.frontMatter.website.host.markdownDescription": "Specify the host URL of your website. [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.website.url)",
|
||||
"setting.frontMatter.website.host.markdownDescription": "Specify the host URL of your website. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.website.url) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.website.url%22%5D)",
|
||||
"command.frontMatter.settings.refresh": "Refresh Front Matter Settings",
|
||||
"setting.frontMatter.config.dynamicFilePath.markdownDescription": "Specify the path to the dynamic config file (ex: [[workspace]]/config.js). [Check in the docs](https://frontmatter.codes/docs/settings/overview#frontmatter.config.dynamicfilepath)",
|
||||
"setting.frontMatter.config.dynamicFilePath.markdownDescription": "Specify the path to the dynamic config file (ex: [[workspace]]/config.js). [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.config.dynamicfilepath) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.config.dynamicfilepath%22%5D)",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.allowAsSubContent.description": "Specify if the content type can be used as sub content.",
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.isSubContent.description": "Specify if the content type is sub content."
|
||||
"setting.frontMatter.taxonomy.contentTypes.items.properties.isSubContent.description": "Specify if the content type is sub content.",
|
||||
|
||||
"setting.frontMatter.git.disableOnBranches.markdownDescription": "Specify the branches on which you want to disable the Git actions. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.git.disableonbranches) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.git.disableonbranches%22%5D)",
|
||||
"setting.frontMatter.git.requiresCommitMessage.markdownDescription": "Specify if you want to require a commit message when publishing your changes for a specified branch. [Docs](https://frontmatter.codes/docs/settings/overview#frontmatter.git.requirescommitmessage) - [View in VS Code](command:simpleBrowser.show?%5B%22https://frontmatter.codes/docs/settings/overview%23frontmatter.git.requirescommitmessage%22%5D)"
|
||||
}
|
||||
@@ -1,3 +1,13 @@
|
||||
import {
|
||||
Position,
|
||||
TextDocument,
|
||||
TextDocumentWillSaveEvent,
|
||||
TextEdit,
|
||||
Uri,
|
||||
commands,
|
||||
window,
|
||||
workspace
|
||||
} from 'vscode';
|
||||
import { Folders } from './Folders';
|
||||
import { DEFAULT_CONTENT_TYPE } from './../constants/ContentType';
|
||||
import { isValidFile } from './../helpers/isValidFile';
|
||||
@@ -10,108 +20,58 @@ import {
|
||||
SETTING_SLUG_PREFIX,
|
||||
SETTING_SLUG_SUFFIX,
|
||||
SETTING_CONTENT_PLACEHOLDERS,
|
||||
TelemetryEvent
|
||||
TelemetryEvent,
|
||||
SETTING_SLUG_TEMPLATE
|
||||
} from './../constants';
|
||||
import * as vscode from 'vscode';
|
||||
import { CustomPlaceholder, Field, TaxonomyType } from '../models';
|
||||
import { CustomPlaceholder, Field } from '../models';
|
||||
import { format } from 'date-fns';
|
||||
import { ArticleHelper, Settings, SlugHelper, TaxonomyHelper } from '../helpers';
|
||||
import {
|
||||
ArticleHelper,
|
||||
Logger,
|
||||
Settings,
|
||||
SlugHelper,
|
||||
processArticlePlaceholdersFromData,
|
||||
processTimePlaceholders
|
||||
} from '../helpers';
|
||||
import { Notifications } from '../helpers/Notifications';
|
||||
import { extname, basename, parse, dirname } from 'path';
|
||||
import { COMMAND_NAME, DefaultFields } from '../constants';
|
||||
import { DashboardData, SnippetRange } from '../models/DashboardData';
|
||||
import { DashboardData, SnippetInfo, SnippetRange } from '../models/DashboardData';
|
||||
import { DateHelper } from '../helpers/DateHelper';
|
||||
import { parseWinPath } from '../helpers/parseWinPath';
|
||||
import { Telemetry } from '../helpers/Telemetry';
|
||||
import { ParsedFrontMatter } from '../parsers';
|
||||
import { MediaListener } from '../listeners/panel';
|
||||
import { NavigationType } from '../dashboardWebView/models';
|
||||
import { processKnownPlaceholders } from '../helpers/PlaceholderHelper';
|
||||
import { Position } from 'vscode';
|
||||
import { SNIPPET } from '../constants/Snippet';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../localization';
|
||||
|
||||
export class Article {
|
||||
/**
|
||||
* Insert taxonomy
|
||||
* Registers the commands for the Article class.
|
||||
*
|
||||
* @param type
|
||||
* @param subscriptions - The array of subscriptions to register the commands with.
|
||||
*/
|
||||
public static async insert(type: TaxonomyType) {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
public static async registerCommands(subscriptions: unknown[]) {
|
||||
subscriptions.push(
|
||||
commands.registerCommand(COMMAND_NAME.setLastModifiedDate, Article.setLastModifiedDate)
|
||||
);
|
||||
|
||||
const article = ArticleHelper.getCurrent();
|
||||
subscriptions.push(commands.registerCommand(COMMAND_NAME.generateSlug, Article.updateSlug));
|
||||
|
||||
if (!article) {
|
||||
return;
|
||||
}
|
||||
// Inserting an image in Markdown
|
||||
subscriptions.push(commands.registerCommand(COMMAND_NAME.insertMedia, Article.insertMedia));
|
||||
|
||||
let options: vscode.QuickPickItem[] = [];
|
||||
const matterProp: string = type === TaxonomyType.Tag ? 'tags' : 'categories';
|
||||
|
||||
// Add the selected options to the options array
|
||||
if (article.data[matterProp]) {
|
||||
const propData = article.data[matterProp];
|
||||
if (propData && propData.length > 0) {
|
||||
options = [...propData]
|
||||
.filter((p) => p)
|
||||
.map(
|
||||
(p) =>
|
||||
({
|
||||
label: p,
|
||||
picked: true
|
||||
} as vscode.QuickPickItem)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Add all the known options to the selection list
|
||||
const crntOptions = (await TaxonomyHelper.get(type)) || [];
|
||||
if (crntOptions && crntOptions.length > 0) {
|
||||
for (const crntOpt of crntOptions) {
|
||||
if (!options.find((o) => o.label === crntOpt)) {
|
||||
options.push({
|
||||
label: crntOpt
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (options.length === 0) {
|
||||
Notifications.info(
|
||||
l10n.t(
|
||||
LocalizationKey.commandsArticleNotificationNoTaxonomy,
|
||||
type === TaxonomyType.Tag ? 'tags' : 'categories'
|
||||
)
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const selectedOptions = await vscode.window.showQuickPick(options, {
|
||||
placeHolder: l10n.t(
|
||||
LocalizationKey.commandsArticleQuickPickPlaceholder,
|
||||
type === TaxonomyType.Tag ? 'tags' : 'categories'
|
||||
),
|
||||
canPickMany: true,
|
||||
ignoreFocusOut: true
|
||||
});
|
||||
|
||||
if (selectedOptions) {
|
||||
article.data[matterProp] = selectedOptions.map((o) => o.label);
|
||||
}
|
||||
|
||||
ArticleHelper.update(editor, article);
|
||||
// Inserting a snippet in Markdown
|
||||
subscriptions.push(commands.registerCommand(COMMAND_NAME.insertSnippet, Article.insertSnippet));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the article date
|
||||
*/
|
||||
public static async setDate() {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
const editor = window.activeTextEditor;
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
@@ -121,7 +81,7 @@ export class Article {
|
||||
return;
|
||||
}
|
||||
|
||||
article = this.updateDate(article);
|
||||
article = await this.updateDate(article);
|
||||
|
||||
try {
|
||||
ArticleHelper.update(editor, article);
|
||||
@@ -136,8 +96,8 @@ export class Article {
|
||||
* Update the date in the front matter
|
||||
* @param article
|
||||
*/
|
||||
public static updateDate(article: ParsedFrontMatter) {
|
||||
article.data = ArticleHelper.updateDates(article);
|
||||
public static async updateDate(article: ParsedFrontMatter) {
|
||||
article.data = await ArticleHelper.updateDates(article);
|
||||
return article;
|
||||
}
|
||||
|
||||
@@ -145,12 +105,12 @@ export class Article {
|
||||
* Sets the article lastmod date
|
||||
*/
|
||||
public static async setLastModifiedDate() {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
const editor = window.activeTextEditor;
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
|
||||
const updatedArticle = this.setLastModifiedDateInner(editor.document);
|
||||
const updatedArticle = await this.setLastModifiedDateInner(editor.document);
|
||||
|
||||
if (typeof updatedArticle === 'undefined') {
|
||||
return;
|
||||
@@ -159,10 +119,8 @@ export class Article {
|
||||
ArticleHelper.update(editor, updatedArticle as ParsedFrontMatter);
|
||||
}
|
||||
|
||||
public static async setLastModifiedDateOnSave(
|
||||
document: vscode.TextDocument
|
||||
): Promise<vscode.TextEdit[]> {
|
||||
const updatedArticle = this.setLastModifiedDateInner(document);
|
||||
public static async setLastModifiedDateOnSave(document: TextDocument): Promise<TextEdit[]> {
|
||||
const updatedArticle = await this.setLastModifiedDateInner(document);
|
||||
|
||||
if (typeof updatedArticle === 'undefined') {
|
||||
return [];
|
||||
@@ -173,9 +131,10 @@ export class Article {
|
||||
return [update];
|
||||
}
|
||||
|
||||
private static setLastModifiedDateInner(
|
||||
document: vscode.TextDocument
|
||||
): ParsedFrontMatter | undefined {
|
||||
private static async setLastModifiedDateInner(
|
||||
document: TextDocument
|
||||
): Promise<ParsedFrontMatter | undefined> {
|
||||
Logger.verbose(`Article:setLastModifiedDateInner:Start`);
|
||||
const article = ArticleHelper.getFrontMatterFromDocument(document);
|
||||
|
||||
// Only set the date, if there is already front matter set
|
||||
@@ -184,9 +143,17 @@ export class Article {
|
||||
}
|
||||
|
||||
const cloneArticle = Object.assign({}, article);
|
||||
const dateField = ArticleHelper.getModifiedDateField(article) || DefaultFields.LastModified;
|
||||
const dateField = await ArticleHelper.getModifiedDateField(article);
|
||||
Logger.verbose(`Article:setLastModifiedDateInner:DateField - ${JSON.stringify(dateField)}`);
|
||||
|
||||
try {
|
||||
cloneArticle.data[dateField] = Article.formatDate(new Date());
|
||||
const fieldName = dateField?.name || DefaultFields.LastModified;
|
||||
const fieldValue = Article.formatDate(new Date(), dateField?.dateFormat);
|
||||
cloneArticle.data[fieldName] = fieldValue;
|
||||
Logger.verbose(
|
||||
`Article:setLastModifiedDateInner:DateField name - ${fieldName} - value - ${fieldValue}`
|
||||
);
|
||||
Logger.verbose(`Article:setLastModifiedDateInner:End`);
|
||||
return cloneArticle;
|
||||
} catch (e: unknown) {
|
||||
Notifications.error(
|
||||
@@ -198,7 +165,7 @@ export class Article {
|
||||
/**
|
||||
* Generate the new slug
|
||||
*/
|
||||
public static generateSlug(title: string) {
|
||||
public static generateSlug(title: string, article?: ParsedFrontMatter, slugTemplate?: string) {
|
||||
if (!title) {
|
||||
return;
|
||||
}
|
||||
@@ -206,13 +173,15 @@ export class Article {
|
||||
const prefix = Settings.get(SETTING_SLUG_PREFIX) as string;
|
||||
const suffix = Settings.get(SETTING_SLUG_SUFFIX) as string;
|
||||
|
||||
const slug = SlugHelper.createSlug(title);
|
||||
if (article?.data) {
|
||||
const slug = SlugHelper.createSlug(title, article?.data, slugTemplate);
|
||||
|
||||
if (slug) {
|
||||
return {
|
||||
slug,
|
||||
slugWithPrefixAndSuffix: `${prefix}${slug}${suffix}`
|
||||
};
|
||||
if (slug) {
|
||||
return {
|
||||
slug,
|
||||
slugWithPrefixAndSuffix: `${prefix}${slug}${suffix}`
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
@@ -225,7 +194,7 @@ export class Article {
|
||||
Telemetry.send(TelemetryEvent.generateSlug);
|
||||
|
||||
const updateFileName = Settings.get(SETTING_SLUG_UPDATE_FILE_NAME) as string;
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
const editor = window.activeTextEditor;
|
||||
|
||||
if (!editor) {
|
||||
return;
|
||||
@@ -237,12 +206,16 @@ export class Article {
|
||||
}
|
||||
|
||||
let filePrefix = Settings.get<string>(SETTING_TEMPLATES_PREFIX);
|
||||
const contentType = ArticleHelper.getContentType(article);
|
||||
filePrefix = ArticleHelper.getFilePrefix(filePrefix, editor.document.uri.fsPath, contentType);
|
||||
const contentType = await ArticleHelper.getContentType(article);
|
||||
filePrefix = await ArticleHelper.getFilePrefix(
|
||||
filePrefix,
|
||||
editor.document.uri.fsPath,
|
||||
contentType
|
||||
);
|
||||
|
||||
const titleField = 'title';
|
||||
const articleTitle: string = article.data[titleField];
|
||||
const slugInfo = Article.generateSlug(articleTitle);
|
||||
const slugInfo = Article.generateSlug(articleTitle, article, contentType.slugTemplate);
|
||||
|
||||
if (slugInfo && slugInfo.slug && slugInfo.slugWithPrefixAndSuffix) {
|
||||
article.data['slug'] = slugInfo.slugWithPrefixAndSuffix;
|
||||
@@ -266,9 +239,13 @@ export class Article {
|
||||
);
|
||||
for (const pField of customPlaceholderFields) {
|
||||
article.data[pField.name] = customPlaceholder.value;
|
||||
article.data[pField.name] = processKnownPlaceholders(
|
||||
article.data[pField.name] = processArticlePlaceholdersFromData(
|
||||
article.data[pField.name],
|
||||
article.data,
|
||||
contentType
|
||||
);
|
||||
article.data[pField.name] = processTimePlaceholders(
|
||||
article.data[pField.name],
|
||||
articleTitle,
|
||||
dateFormat
|
||||
);
|
||||
}
|
||||
@@ -280,7 +257,7 @@ export class Article {
|
||||
// Check if the file name should be updated by the slug
|
||||
// This is required for systems like Jekyll
|
||||
if (updateFileName) {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
const editor = window.activeTextEditor;
|
||||
if (editor) {
|
||||
const ext = extname(editor.document.fileName);
|
||||
const fileName = basename(editor.document.fileName);
|
||||
@@ -298,7 +275,7 @@ export class Article {
|
||||
try {
|
||||
await editor.document.save();
|
||||
|
||||
await vscode.workspace.fs.rename(editor.document.uri, vscode.Uri.file(newPath), {
|
||||
await workspace.fs.rename(editor.document.uri, Uri.file(newPath), {
|
||||
overwrite: false
|
||||
});
|
||||
} catch (e: unknown) {
|
||||
@@ -317,22 +294,43 @@ export class Article {
|
||||
/**
|
||||
* Retrieve the slug from the front matter
|
||||
*/
|
||||
public static getSlug() {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
public static getSlug(pathname?: string) {
|
||||
const editor = window.activeTextEditor;
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
|
||||
const file = parseWinPath(editor.document.fileName);
|
||||
|
||||
if (!isValidFile(file)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const parsedFile = parse(file);
|
||||
|
||||
const slugTemplate = Settings.get<string>(SETTING_SLUG_TEMPLATE);
|
||||
if (slugTemplate) {
|
||||
if (slugTemplate === '{{title}}') {
|
||||
const article = ArticleHelper.getFrontMatter(editor);
|
||||
if (article?.data?.title) {
|
||||
return article.data.title.toLowerCase().replace(/\s/g, '-');
|
||||
}
|
||||
} else {
|
||||
const article = ArticleHelper.getFrontMatter(editor);
|
||||
if (article?.data) {
|
||||
return SlugHelper.createSlug(article.data.title, article.data, slugTemplate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const suffix = Settings.get(SETTING_SLUG_SUFFIX) as string;
|
||||
const prefix = Settings.get(SETTING_SLUG_PREFIX) as string;
|
||||
|
||||
if (parsedFile.name.toLowerCase() !== 'index') {
|
||||
return parsedFile.name;
|
||||
return `${prefix}${parsedFile.name}${suffix}`;
|
||||
}
|
||||
|
||||
if (parsedFile.name.toLowerCase() === 'index' && pathname) {
|
||||
return ``;
|
||||
}
|
||||
|
||||
const folderName = basename(dirname(file));
|
||||
@@ -343,7 +341,7 @@ export class Article {
|
||||
* Toggle the page its draft mode
|
||||
*/
|
||||
public static async toggleDraft() {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
const editor = window.activeTextEditor;
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
@@ -361,13 +359,13 @@ export class Article {
|
||||
* Article auto updater
|
||||
* @param event
|
||||
*/
|
||||
public static async autoUpdate(event: vscode.TextDocumentWillSaveEvent) {
|
||||
public static async autoUpdate(event: TextDocumentWillSaveEvent) {
|
||||
const document = event.document;
|
||||
if (document && ArticleHelper.isSupportedFile(document)) {
|
||||
const autoUpdate = Settings.get(SETTING_AUTO_UPDATE_DATE);
|
||||
|
||||
// Is article located in one of the content folders
|
||||
const folders = Folders.get();
|
||||
const folders = Folders.getCached();
|
||||
const documentPath = parseWinPath(document.fileName);
|
||||
const folder = folders.find((f) => documentPath.startsWith(f.path));
|
||||
if (!folder) {
|
||||
@@ -386,11 +384,16 @@ export class Article {
|
||||
public static formatDate(dateValue: Date, fieldDateFormat?: string): string {
|
||||
const dateFormat = Settings.get(SETTING_DATE_FORMAT) as string;
|
||||
|
||||
Logger.verbose(`Article:formatDate:Start`);
|
||||
|
||||
if (fieldDateFormat) {
|
||||
Logger.verbose(`Article:formatDate:FieldDateFormat - ${fieldDateFormat}`);
|
||||
return format(dateValue, DateHelper.formatUpdate(fieldDateFormat) as string);
|
||||
} else if (dateFormat && typeof dateFormat === 'string') {
|
||||
Logger.verbose(`Article:formatDate:DateFormat - ${dateFormat}`);
|
||||
return format(dateValue, DateHelper.formatUpdate(dateFormat) as string);
|
||||
} else {
|
||||
Logger.verbose(`Article:formatDate:toISOString - ${dateValue}`);
|
||||
return typeof dateValue.toISOString === 'function'
|
||||
? dateValue.toISOString()
|
||||
: dateValue?.toString();
|
||||
@@ -401,19 +404,19 @@ export class Article {
|
||||
* Insert an image from the media dashboard into the article
|
||||
*/
|
||||
public static async insertMedia() {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
const editor = window.activeTextEditor;
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
|
||||
const article = ArticleHelper.getFrontMatter(editor);
|
||||
const contentType =
|
||||
article && article.data ? ArticleHelper.getContentType(article) : DEFAULT_CONTENT_TYPE;
|
||||
article && article.data ? await ArticleHelper.getContentType(article) : DEFAULT_CONTENT_TYPE;
|
||||
|
||||
const position = editor.selection.active;
|
||||
const selectionText = editor.document.getText(editor.selection);
|
||||
|
||||
await vscode.commands.executeCommand(COMMAND_NAME.dashboard, {
|
||||
await commands.executeCommand(COMMAND_NAME.dashboard, {
|
||||
type: 'media',
|
||||
data: {
|
||||
pageBundle: !!contentType.pageBundle,
|
||||
@@ -432,12 +435,12 @@ export class Article {
|
||||
* Insert a snippet into the article
|
||||
*/
|
||||
public static async insertSnippet() {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
const editor = window.activeTextEditor;
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
|
||||
let position = editor.selection.active;
|
||||
const position = editor.selection.active;
|
||||
const selectionText = editor.document.getText(editor.selection);
|
||||
|
||||
// Check for snippet wrapper
|
||||
@@ -462,7 +465,7 @@ export class Article {
|
||||
snippetStartBeforePos = linesBeforeSelection.length - snippetStartBeforePos - 1;
|
||||
}
|
||||
|
||||
let snippetInfo: { id: string; fields: any[] } | undefined = undefined;
|
||||
let snippetInfo: SnippetInfo | undefined = undefined;
|
||||
let range: SnippetRange | undefined = undefined;
|
||||
if (
|
||||
snippetEndAfterPos > -1 &&
|
||||
@@ -486,13 +489,15 @@ export class Article {
|
||||
}
|
||||
|
||||
const article = ArticleHelper.getFrontMatter(editor);
|
||||
const contentType = article ? await ArticleHelper.getContentType(article) : undefined;
|
||||
|
||||
await vscode.commands.executeCommand(COMMAND_NAME.dashboard, {
|
||||
await commands.executeCommand(COMMAND_NAME.dashboard, {
|
||||
type: NavigationType.Snippets,
|
||||
data: {
|
||||
fileTitle: article?.data.title || '',
|
||||
filePath: editor.document.uri.fsPath,
|
||||
fieldName: basename(editor.document.uri.fsPath),
|
||||
contentType,
|
||||
position,
|
||||
range,
|
||||
selection: selectionText,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { authentication, commands, ExtensionContext } from 'vscode';
|
||||
import { COMMAND_NAME, CONTEXT } from '../constants';
|
||||
import { Extension, Logger } from '../helpers';
|
||||
import fetch from 'node-fetch';
|
||||
import { Dashboard } from './Dashboard';
|
||||
import { SettingsListener } from '../listeners/panel';
|
||||
import { PanelProvider } from '../panelWebView/PanelProvider';
|
||||
|
||||
@@ -22,7 +22,7 @@ export class Cache {
|
||||
await Extension.getInstance().setState(key, data, type);
|
||||
}
|
||||
|
||||
public static async clear(showNotification: boolean = true) {
|
||||
public static async clear(showNotification = true) {
|
||||
const ext = Extension.getInstance();
|
||||
|
||||
await ext.setState(ExtensionState.Dashboard.Pages.Cache, undefined, 'workspace', true);
|
||||
|
||||
@@ -1,10 +1,25 @@
|
||||
import { commands, QuickPickItem, window } from 'vscode';
|
||||
import { COMMAND_NAME, SETTING_TEMPLATES_ENABLED } from '../constants';
|
||||
import { Settings } from '../helpers';
|
||||
import { Extension, Settings } from '../helpers';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../localization';
|
||||
|
||||
export class Content {
|
||||
/**
|
||||
* Registers the commands for the Content class.
|
||||
*/
|
||||
public static async registerCommands() {
|
||||
const ext = Extension.getInstance();
|
||||
const subscriptions = ext.subscriptions;
|
||||
|
||||
subscriptions.push(commands.registerCommand(COMMAND_NAME.createContent, Content.create));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates content based on user selection.
|
||||
* If templates are enabled, shows a quick pick menu to choose between content type and template.
|
||||
* If templates are disabled, executes the createByContentType command directly.
|
||||
*/
|
||||
public static async create() {
|
||||
const templatesEnabled = await Settings.get(SETTING_TEMPLATES_ENABLED);
|
||||
if (!templatesEnabled) {
|
||||
|
||||
@@ -3,11 +3,13 @@ import {
|
||||
CONTEXT,
|
||||
ExtensionState,
|
||||
SETTING_EXPERIMENTAL,
|
||||
SETTING_EXTENSIBILITY_SCRIPTS
|
||||
SETTING_EXTENSIBILITY_SCRIPTS,
|
||||
COMMAND_NAME,
|
||||
TelemetryEvent
|
||||
} from '../constants';
|
||||
import { join } from 'path';
|
||||
import { commands, Uri, ViewColumn, Webview, WebviewPanel, window } from 'vscode';
|
||||
import { Logger, Settings as SettingsHelper } from '../helpers';
|
||||
import { DashboardSettings, Logger, Settings as SettingsHelper, Telemetry } from '../helpers';
|
||||
import { DashboardCommand } from '../dashboardWebView/DashboardCommand';
|
||||
import { Extension } from '../helpers/Extension';
|
||||
import { WebviewHelper } from '@estruyf/vscode';
|
||||
@@ -22,7 +24,6 @@ import {
|
||||
ExtensionListener,
|
||||
SnippetListener,
|
||||
TaxonomyListener,
|
||||
LogListener,
|
||||
LocalizationListener,
|
||||
SsgListener
|
||||
} from '../listeners/dashboard';
|
||||
@@ -31,6 +32,9 @@ import { GitListener, ModeListener } from '../listeners/general';
|
||||
import { Folders } from './Folders';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../localization';
|
||||
import { DashboardMessage } from '../dashboardWebView/DashboardMessage';
|
||||
import { NavigationType } from '../dashboardWebView/models';
|
||||
import { ignoreMsgCommand } from '../utils';
|
||||
|
||||
export class Dashboard {
|
||||
private static webview: WebviewPanel | null = null;
|
||||
@@ -41,6 +45,13 @@ export class Dashboard {
|
||||
return Dashboard._viewData;
|
||||
}
|
||||
|
||||
public static setTitle(title: string) {
|
||||
if (title && Dashboard.webview) {
|
||||
Dashboard.webview.title =
|
||||
title || `Front Matter ${l10n.t(LocalizationKey.commandsDashboardTitle)}`;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Init the dashboard
|
||||
*/
|
||||
@@ -51,6 +62,56 @@ export class Dashboard {
|
||||
}
|
||||
}
|
||||
|
||||
public static registerCommands() {
|
||||
const subscriptions = Extension.getInstance().subscriptions;
|
||||
|
||||
subscriptions.push(
|
||||
commands.registerCommand(COMMAND_NAME.dashboard, (data?: DashboardData) => {
|
||||
Telemetry.send(TelemetryEvent.openContentDashboard);
|
||||
if (!data) {
|
||||
Dashboard.open({ type: NavigationType.Contents });
|
||||
} else {
|
||||
Dashboard.open(data);
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
subscriptions.push(
|
||||
commands.registerCommand(COMMAND_NAME.dashboardMedia, () => {
|
||||
Telemetry.send(TelemetryEvent.openMediaDashboard);
|
||||
Dashboard.open({ type: NavigationType.Media });
|
||||
})
|
||||
);
|
||||
|
||||
subscriptions.push(
|
||||
commands.registerCommand(COMMAND_NAME.dashboardSnippets, () => {
|
||||
Telemetry.send(TelemetryEvent.openSnippetsDashboard);
|
||||
Dashboard.open({ type: NavigationType.Snippets });
|
||||
})
|
||||
);
|
||||
|
||||
subscriptions.push(
|
||||
commands.registerCommand(COMMAND_NAME.dashboardData, () => {
|
||||
Telemetry.send(TelemetryEvent.openDataDashboard);
|
||||
Dashboard.open({ type: NavigationType.Data });
|
||||
})
|
||||
);
|
||||
|
||||
subscriptions.push(
|
||||
commands.registerCommand(COMMAND_NAME.dashboardTaxonomy, () => {
|
||||
Telemetry.send(TelemetryEvent.openTaxonomyDashboard);
|
||||
Dashboard.open({ type: NavigationType.Taxonomy });
|
||||
})
|
||||
);
|
||||
|
||||
subscriptions.push(
|
||||
commands.registerCommand(COMMAND_NAME.dashboardClose, () => {
|
||||
Telemetry.send(TelemetryEvent.closeDashboard);
|
||||
Dashboard.close();
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Open or reveal the dashboard
|
||||
*/
|
||||
@@ -160,6 +221,7 @@ export class Dashboard {
|
||||
Dashboard.isDisposed = true;
|
||||
Dashboard._viewData = undefined;
|
||||
PanelMediaListener.getMediaSelection();
|
||||
DashboardSettings.updateAfterClose();
|
||||
await commands.executeCommand('setContext', CONTEXT.isDashboardOpen, false);
|
||||
});
|
||||
|
||||
@@ -168,7 +230,9 @@ export class Dashboard {
|
||||
});
|
||||
|
||||
Dashboard.webview.webview.onDidReceiveMessage(async (msg) => {
|
||||
Logger.info(`Receiving message from webview: ${msg.command}`);
|
||||
if (!ignoreMsgCommand(msg.command)) {
|
||||
Logger.verbose(`Receiving message from dashboard: ${msg.command}`);
|
||||
}
|
||||
|
||||
LocalizationListener.process(msg);
|
||||
DashboardListener.process(msg);
|
||||
@@ -182,7 +246,6 @@ export class Dashboard {
|
||||
ModeListener.process(msg);
|
||||
GitListener.process(msg);
|
||||
TaxonomyListener.process(msg);
|
||||
LogListener.process(msg);
|
||||
SsgListener.process(msg);
|
||||
});
|
||||
}
|
||||
@@ -203,7 +266,7 @@ export class Dashboard {
|
||||
* @param msg
|
||||
*/
|
||||
public static postWebviewMessage(msg: {
|
||||
command: DashboardCommand;
|
||||
command: DashboardCommand | DashboardMessage;
|
||||
requestId?: string;
|
||||
payload?: unknown;
|
||||
error?: unknown;
|
||||
@@ -303,7 +366,7 @@ export class Dashboard {
|
||||
version.usedVersion ? '' : `data-showWelcome="true"`
|
||||
} ${
|
||||
experimental ? `data-experimental="${experimental}"` : ''
|
||||
} data-webview-url="${webviewUrl}" ></div>
|
||||
} data-webview-url="${webviewUrl}" data-is-crash-disabled="${!Telemetry.isVscodeEnabled()}" ></div>
|
||||
|
||||
${(scriptsToLoad || [])
|
||||
.map((script) => {
|
||||
|
||||
@@ -1,13 +1,26 @@
|
||||
import { Folders } from './Folders';
|
||||
import { ViewColumn, workspace } from 'vscode';
|
||||
import { ViewColumn, commands, workspace } from 'vscode';
|
||||
import ContentProvider from '../providers/ContentProvider';
|
||||
import { join } from 'path';
|
||||
import { ContentFolder } from '../models';
|
||||
import { Settings } from '../helpers/SettingsHelper';
|
||||
import {
|
||||
COMMAND_NAME,
|
||||
DEFAULT_FILE_TYPES,
|
||||
SETTING_CONTENT_SUPPORTED_FILETYPES
|
||||
} from '../constants';
|
||||
import { Extension } from '../helpers';
|
||||
|
||||
export class Diagnostics {
|
||||
public static async registerCommands() {
|
||||
const ext = Extension.getInstance();
|
||||
const subscriptions = ext.subscriptions;
|
||||
|
||||
subscriptions.push(commands.registerCommand(COMMAND_NAME.diagnostics, Diagnostics.show));
|
||||
}
|
||||
|
||||
public static async show() {
|
||||
const folders = Folders.get();
|
||||
const folders = await Folders.get();
|
||||
const projectName = Folders.getProjectFolderName();
|
||||
const wsFolder = Folders.getWorkspaceFolder();
|
||||
|
||||
@@ -18,27 +31,38 @@ export class Diagnostics {
|
||||
|
||||
const all = await Diagnostics.allProjectFiles();
|
||||
|
||||
const logging = `# Project name
|
||||
const fileTypes = Diagnostics.getFileTypes();
|
||||
|
||||
const logging = `# ${Extension.getInstance().displayName} - Diagnostics
|
||||
|
||||
Beta: \`${Extension.getInstance().isBetaVersion()}\`
|
||||
Version: \`${Extension.getInstance().version}\`
|
||||
|
||||
## Project name
|
||||
|
||||
${projectName}
|
||||
|
||||
# Folders
|
||||
## Workspace folder
|
||||
|
||||
${folders.map((f) => `- ${f.title}: "${f.path}"`).join('\n')}
|
||||
\`${wsFolder ? wsFolder.fsPath : 'No workspace folder'}\`
|
||||
|
||||
# Workspace folder
|
||||
|
||||
${wsFolder ? wsFolder.fsPath : 'No workspace folder'}
|
||||
|
||||
# Total files
|
||||
## Total files
|
||||
|
||||
${all}
|
||||
|
||||
# Folders to search files
|
||||
## Folders
|
||||
|
||||
| Title | Path |
|
||||
| ----- | ---- |
|
||||
${folders.map((f) => `| ${f.title} | \`${f.path}\` |`).join('\n')}
|
||||
|
||||
### Files in folders
|
||||
|
||||
| Project start length | Search in | ${fileTypes.join(` | `)} |
|
||||
|--- | --- | --- | --- | --- |
|
||||
${folderData.join('\n')}
|
||||
|
||||
# Complete frontmatter.json config
|
||||
## Complete frontmatter.json config
|
||||
|
||||
\`\`\`json
|
||||
${JSON.stringify(Settings.globalConfig, null, 2)}
|
||||
@@ -48,8 +72,12 @@ ${JSON.stringify(Settings.globalConfig, null, 2)}
|
||||
ContentProvider.show(logging, `${projectName} diagnostics`, 'markdown', ViewColumn.One);
|
||||
}
|
||||
|
||||
private static getFileTypes = (): string[] => {
|
||||
return Settings.get<string[]>(SETTING_CONTENT_SUPPORTED_FILETYPES) || DEFAULT_FILE_TYPES;
|
||||
};
|
||||
|
||||
private static async allProjectFiles() {
|
||||
const allFiles = await workspace.findFiles(`**/*.*`);
|
||||
const allFiles = await workspace.findFiles(`**/*.*`, '**/node_modules/**');
|
||||
return `Total files found: ${allFiles.length}`;
|
||||
}
|
||||
|
||||
@@ -59,22 +87,19 @@ ${JSON.stringify(Settings.globalConfig, null, 2)}
|
||||
projectStart = projectStart?.replace(/\\/g, '/');
|
||||
projectStart = projectStart?.startsWith('/') ? projectStart.substring(1) : projectStart;
|
||||
|
||||
const mdFiles = await workspace.findFiles(
|
||||
join(projectStart, folder.excludeSubdir ? '/' : '**/', '*.md')
|
||||
);
|
||||
const mdxFiles = await workspace.findFiles(
|
||||
join(projectStart, folder.excludeSubdir ? '/' : '**/', '*.mdx')
|
||||
);
|
||||
const markdownFiles = await workspace.findFiles(
|
||||
join(projectStart, folder.excludeSubdir ? '/' : '**/', '*.markdown')
|
||||
const fileTypes = Diagnostics.getFileTypes();
|
||||
const fileTypeLengths = await Promise.all(
|
||||
fileTypes.map(async (ft) => {
|
||||
const path = join(projectStart || '', folder.excludeSubdir ? '/' : '**/', `*.${ft}`);
|
||||
const files = await workspace.findFiles(path, '**/node_modules/**');
|
||||
return (files || []).length;
|
||||
})
|
||||
);
|
||||
|
||||
return `- Project start length: ${projectStart.length} | Search in: "${join(
|
||||
return `| ${projectStart.length} | \`${join(
|
||||
projectStart,
|
||||
folder.excludeSubdir ? '/' : '**/',
|
||||
'*.*'
|
||||
)}" | mdFiles: ${mdFiles.length} | mdxFiles: ${mdxFiles.length} | markdownFiles: ${
|
||||
markdownFiles.length
|
||||
}`;
|
||||
)}\` | ${fileTypeLengths.join(` | `)} |`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { STATIC_FOLDER_PLACEHOLDER } from './../constants/StaticFolderPlaceholder';
|
||||
import { Questions } from './../helpers/Questions';
|
||||
import {
|
||||
COMMAND_NAME,
|
||||
SETTING_CONTENT_I18N,
|
||||
SETTING_CONTENT_PAGE_FOLDERS,
|
||||
SETTING_CONTENT_STATIC_FOLDER,
|
||||
SETTING_CONTENT_SUPPORTED_FILETYPES,
|
||||
@@ -9,11 +11,18 @@ import {
|
||||
} from './../constants';
|
||||
import { commands, Uri, workspace, window } from 'vscode';
|
||||
import { basename, dirname, join, relative, sep } from 'path';
|
||||
import { ContentFolder, FileInfo, FolderInfo, StaticFolder } from '../models';
|
||||
import {
|
||||
ContentFolder,
|
||||
ContentType,
|
||||
FileInfo,
|
||||
FolderInfo,
|
||||
I18nConfig,
|
||||
StaticFolder
|
||||
} from '../models';
|
||||
import uniqBy = require('lodash.uniqby');
|
||||
import { Template } from './Template';
|
||||
import { Notifications } from '../helpers/Notifications';
|
||||
import { Logger, processKnownPlaceholders, Settings } from '../helpers';
|
||||
import { Extension, Logger, Settings, processTimePlaceholders } from '../helpers';
|
||||
import { existsSync } from 'fs';
|
||||
import { format } from 'date-fns';
|
||||
import { Dashboard } from './Dashboard';
|
||||
@@ -24,13 +33,28 @@ import { DEFAULT_FILE_TYPES } from '../constants/DefaultFileTypes';
|
||||
import { Telemetry } from '../helpers/Telemetry';
|
||||
import { glob } from 'glob';
|
||||
import { mkdirAsync } from '../utils/mkdirAsync';
|
||||
import { existsAsync } from '../utils';
|
||||
import { existsAsync, isWindows } from '../utils';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../localization';
|
||||
import { Preview } from './Preview';
|
||||
|
||||
export const WORKSPACE_PLACEHOLDER = `[[workspace]]`;
|
||||
|
||||
export class Folders {
|
||||
private static _folders: ContentFolder[] = [];
|
||||
|
||||
public static async registerCommands() {
|
||||
const ext = Extension.getInstance();
|
||||
const subscriptions = ext.subscriptions;
|
||||
|
||||
subscriptions.push(commands.registerCommand(COMMAND_NAME.createByTemplate, Folders.create));
|
||||
}
|
||||
|
||||
public static clearCached() {
|
||||
Logger.verbose(`Folders:clearCached`);
|
||||
Folders._folders = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a media folder
|
||||
* @returns
|
||||
@@ -97,8 +121,9 @@ export class Folders {
|
||||
return;
|
||||
}
|
||||
|
||||
const folders = Folders.get().filter((f) => !f.disableCreation);
|
||||
const location = folders.find((f) => f.title === selectedFolder);
|
||||
let folders = await Folders.get();
|
||||
folders = folders.filter((f) => !f.disableCreation);
|
||||
const location = folders.find((f) => f.path === selectedFolder.path);
|
||||
if (location) {
|
||||
const folderPath = Folders.getFolderPath(Uri.file(location.path));
|
||||
if (folderPath) {
|
||||
@@ -121,7 +146,7 @@ export class Folders {
|
||||
if (folder && folder.fsPath) {
|
||||
const wslPath = folder.fsPath.replace(/\//g, '\\');
|
||||
|
||||
let folders = Folders.get();
|
||||
let folders = await Folders.get();
|
||||
|
||||
const exists = folders.find(
|
||||
(f) => f.path.includes(folder.fsPath) || f.path.includes(wslPath)
|
||||
@@ -170,7 +195,7 @@ export class Folders {
|
||||
*/
|
||||
public static async unregister(folder: Uri) {
|
||||
if (folder && folder.path) {
|
||||
let folders = Folders.get();
|
||||
let folders = await Folders.get();
|
||||
folders = folders.filter((f) => f.path !== folder.fsPath);
|
||||
await Folders.update(folders);
|
||||
|
||||
@@ -281,81 +306,25 @@ export class Folders {
|
||||
* Get the registered folders information
|
||||
*/
|
||||
public static async getInfo(limit?: number): Promise<FolderInfo[] | null> {
|
||||
Logger.verbose('Folders:getInfo:start');
|
||||
const supportedFiles = Settings.get<string[]>(SETTING_CONTENT_SUPPORTED_FILETYPES);
|
||||
const folders = Folders.get();
|
||||
const wsFolder = parseWinPath(Folders.getWorkspaceFolder()?.fsPath || '');
|
||||
const folders = await Folders.get();
|
||||
|
||||
if (folders && folders.length > 0) {
|
||||
const folderInfo: FolderInfo[] = [];
|
||||
|
||||
for (const folder of folders) {
|
||||
try {
|
||||
const folderPath = parseWinPath(folder.path);
|
||||
|
||||
if (typeof folderPath === 'string') {
|
||||
let files: Uri[] = [];
|
||||
|
||||
for (const fileType of supportedFiles || DEFAULT_FILE_TYPES) {
|
||||
let filePath = join(
|
||||
folderPath,
|
||||
folder.excludeSubdir ? '/' : '**',
|
||||
`*${fileType.startsWith('.') ? '' : '.'}${fileType}`
|
||||
);
|
||||
|
||||
if (folderPath === '' && folder.excludeSubdir) {
|
||||
filePath = `*${fileType.startsWith('.') ? '' : '.'}${fileType}`;
|
||||
}
|
||||
|
||||
let foundFiles = await Folders.findFiles(filePath);
|
||||
|
||||
// Make sure these file are coming from the folder path (this could be an issue in multi-root workspaces)
|
||||
foundFiles = foundFiles.filter((f) => parseWinPath(f.fsPath).startsWith(folderPath));
|
||||
|
||||
files = [...files, ...foundFiles];
|
||||
}
|
||||
|
||||
if (files) {
|
||||
let fileStats: FileInfo[] = [];
|
||||
|
||||
for (const file of files) {
|
||||
try {
|
||||
const fileName = basename(file.fsPath);
|
||||
const folderName = dirname(file.fsPath).split(sep).pop();
|
||||
|
||||
const stats = await workspace.fs.stat(file);
|
||||
|
||||
fileStats.push({
|
||||
filePath: file.fsPath,
|
||||
fileName,
|
||||
folderName,
|
||||
...stats
|
||||
});
|
||||
} catch (error) {
|
||||
// Skip the file
|
||||
}
|
||||
}
|
||||
|
||||
fileStats = fileStats.sort((a, b) => b.mtime - a.mtime);
|
||||
|
||||
if (limit) {
|
||||
fileStats = fileStats.slice(0, limit);
|
||||
}
|
||||
|
||||
folderInfo.push({
|
||||
title: folder.title,
|
||||
files: files.length,
|
||||
lastModified: fileStats
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// Skip the current folder
|
||||
const crntFolderInfo = await Folders.getFilesByFolder(folder, supportedFiles, limit);
|
||||
if (crntFolderInfo) {
|
||||
folderInfo.push(crntFolderInfo);
|
||||
}
|
||||
}
|
||||
|
||||
Logger.verbose('Folders:getInfo:end');
|
||||
return folderInfo;
|
||||
}
|
||||
|
||||
Logger.verbose('Folders:getInfo:end - no folders found');
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -363,14 +332,44 @@ export class Folders {
|
||||
* Get the folder settings
|
||||
* @returns
|
||||
*/
|
||||
public static get(): ContentFolder[] {
|
||||
public static async get(): Promise<ContentFolder[]> {
|
||||
Logger.verbose('Folders:get:start');
|
||||
|
||||
if (Folders._folders.length > 0) {
|
||||
Logger.verbose('Folders:get:end - cached folders');
|
||||
return Folders._folders;
|
||||
}
|
||||
|
||||
const wsFolder = Folders.getWorkspaceFolder();
|
||||
let folders: ContentFolder[] = Settings.get(SETTING_CONTENT_PAGE_FOLDERS) as ContentFolder[];
|
||||
const i18nSettings = Settings.get<I18nConfig[]>(SETTING_CONTENT_I18N);
|
||||
|
||||
// Filter out folders without a path
|
||||
folders = folders.filter((f) => f.path);
|
||||
|
||||
const contentFolders = folders.map((folder) => {
|
||||
const contentFolders: ContentFolder[] = [];
|
||||
|
||||
// Check if wildcard is used
|
||||
const wildcardFolders = folders.filter((f) => f.path.includes('*'));
|
||||
if (wildcardFolders && wildcardFolders.length > 0) {
|
||||
for (const folder of wildcardFolders) {
|
||||
folders = folders.filter((f) => f.path !== folder.path);
|
||||
|
||||
const folderPath = Folders.absWsFolder(folder, wsFolder);
|
||||
const subFolders = await Folders.findFolders(folderPath);
|
||||
for (const subFolder of subFolders) {
|
||||
const subFolderPath = parseWinPath(subFolder);
|
||||
|
||||
folders.push({
|
||||
...folder,
|
||||
title: `${folder.title} (${subFolderPath.replace(wsFolder?.fsPath || '', '')})`,
|
||||
path: subFolderPath
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
folders.forEach((folder) => {
|
||||
if (!folder.title) {
|
||||
folder.title = basename(folder.path);
|
||||
}
|
||||
@@ -378,7 +377,7 @@ export class Folders {
|
||||
let folderPath: string | undefined = Folders.absWsFolder(folder, wsFolder);
|
||||
if (folderPath.includes(`{{`) && folderPath.includes(`}}`)) {
|
||||
const dateFormat = Settings.get(SETTING_DATE_FORMAT) as string;
|
||||
folderPath = processKnownPlaceholders(folderPath, undefined, dateFormat);
|
||||
folderPath = processTimePlaceholders(folderPath, dateFormat);
|
||||
} else {
|
||||
if (folderPath && !existsSync(folderPath)) {
|
||||
Notifications.errorShowOnce(
|
||||
@@ -388,11 +387,11 @@ export class Folders {
|
||||
),
|
||||
l10n.t(LocalizationKey.commandsFoldersGetNotificationErrorRemoveAction),
|
||||
l10n.t(LocalizationKey.commandsFoldersGetNotificationErrorCreateAction)
|
||||
).then((answer) => {
|
||||
).then(async (answer) => {
|
||||
if (
|
||||
answer === l10n.t(LocalizationKey.commandsFoldersGetNotificationErrorRemoveAction)
|
||||
) {
|
||||
const folders = Folders.get();
|
||||
const folders = await Folders.get();
|
||||
Folders.update(folders.filter((f) => f.path !== folder.path));
|
||||
} else if (
|
||||
answer === l10n.t(LocalizationKey.commandsFoldersGetNotificationErrorCreateAction)
|
||||
@@ -404,14 +403,65 @@ export class Folders {
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
...folder,
|
||||
originalPath: folder.path,
|
||||
path: folderPath
|
||||
};
|
||||
// Check i18n
|
||||
if (folder.defaultLocale && (folder.locales || i18nSettings)) {
|
||||
const i18nConfig =
|
||||
folder.locales && folder.locales.length > 0 ? folder.locales : i18nSettings;
|
||||
|
||||
let defaultLocale;
|
||||
let sourcePath = folderPath;
|
||||
let localeFolders: ContentFolder[] = [];
|
||||
|
||||
if (i18nConfig && i18nConfig.length > 0) {
|
||||
for (const i18n of i18nConfig) {
|
||||
if (i18n.locale === folder.defaultLocale) {
|
||||
defaultLocale = i18n;
|
||||
} else if (i18n.locale !== folder.defaultLocale && i18n.path) {
|
||||
localeFolders.push({
|
||||
...folder,
|
||||
title: folder.title,
|
||||
originalPath: folder.path,
|
||||
locale: i18n.locale,
|
||||
localeTitle: i18n?.title || i18n.locale,
|
||||
localeSourcePath: sourcePath,
|
||||
path: parseWinPath(join(folderPath, i18n.path))
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
contentFolders.push({
|
||||
...folder,
|
||||
title: folder.title,
|
||||
locale: folder.defaultLocale,
|
||||
localeTitle: defaultLocale?.title || folder.defaultLocale,
|
||||
originalPath: folder.path,
|
||||
localeSourcePath: sourcePath,
|
||||
path: parseWinPath(join(folderPath, defaultLocale?.path || ''))
|
||||
});
|
||||
|
||||
contentFolders.push(...localeFolders);
|
||||
} else {
|
||||
contentFolders.push({
|
||||
...folder,
|
||||
locale: folder.defaultLocale,
|
||||
originalPath: folder.path,
|
||||
path: folderPath
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return contentFolders.filter((folder) => folder !== null) as ContentFolder[];
|
||||
Logger.verbose('Folders:get:end');
|
||||
Folders._folders = contentFolders.filter((folder) => folder !== null) as ContentFolder[];
|
||||
return Folders._folders;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the cached folder settings
|
||||
* @returns {ContentFolder[]} - The cached folder settings
|
||||
*/
|
||||
public static getCached(): ContentFolder[] {
|
||||
return Folders._folders;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -419,8 +469,13 @@ export class Folders {
|
||||
* @param folders
|
||||
*/
|
||||
public static async update(folders: ContentFolder[]) {
|
||||
const originalFolders = Settings.get(SETTING_CONTENT_PAGE_FOLDERS) as ContentFolder[];
|
||||
const wsFolder = Folders.getWorkspaceFolder();
|
||||
|
||||
// Filter out the locale folders
|
||||
folders = folders.filter((folder) => !folder.locale || folder.locale === folder.defaultLocale);
|
||||
|
||||
// Remove the internal FM properties
|
||||
const folderDetails = folders
|
||||
.map((folder) => {
|
||||
const detail = {
|
||||
@@ -428,17 +483,29 @@ export class Folders {
|
||||
path: Folders.relWsFolder(folder, wsFolder)
|
||||
};
|
||||
|
||||
if (detail['$schema'] || detail.extended) {
|
||||
return null;
|
||||
delete detail['$schema'];
|
||||
delete detail.extended;
|
||||
|
||||
if (detail.locale && detail.locale === detail.defaultLocale) {
|
||||
// Check if the folder was on the original list
|
||||
const originalFolder = originalFolders.find((f) => f.path === folder.originalPath);
|
||||
|
||||
if (originalFolder && !originalFolder.locales && folder.locales) {
|
||||
delete detail.locales;
|
||||
}
|
||||
|
||||
delete detail.localeSourcePath;
|
||||
delete detail.localeTitle;
|
||||
}
|
||||
|
||||
delete detail.locale;
|
||||
delete detail.originalPath;
|
||||
|
||||
return detail;
|
||||
})
|
||||
.filter((folder) => folder !== null);
|
||||
|
||||
await Settings.update(SETTING_CONTENT_PAGE_FOLDERS, folderDetails, true);
|
||||
await Settings.safeUpdate(SETTING_CONTENT_PAGE_FOLDERS, folderDetails, true);
|
||||
|
||||
// Reinitialize the folder listeners
|
||||
PagesListener.startWatchers();
|
||||
@@ -451,11 +518,10 @@ export class Folders {
|
||||
*/
|
||||
public static getAbsFilePath(filePath: string): string {
|
||||
const wsFolder = Folders.getWorkspaceFolder();
|
||||
const isWindows = process.platform === 'win32';
|
||||
|
||||
if (filePath.includes(WORKSPACE_PLACEHOLDER)) {
|
||||
let absPath = filePath.replace(WORKSPACE_PLACEHOLDER, parseWinPath(wsFolder?.fsPath || ''));
|
||||
absPath = isWindows ? absPath.split('/').join('\\') : absPath;
|
||||
absPath = isWindows() ? absPath.split('/').join('\\') : absPath;
|
||||
return parseWinPath(absPath);
|
||||
}
|
||||
|
||||
@@ -469,7 +535,6 @@ export class Folders {
|
||||
*/
|
||||
public static getAbsFolderPath(folderPath: string): string {
|
||||
const wsFolder = Folders.getWorkspaceFolder();
|
||||
const isWindows = process.platform === 'win32';
|
||||
|
||||
let absPath = '';
|
||||
if (folderPath.includes(WORKSPACE_PLACEHOLDER)) {
|
||||
@@ -478,7 +543,7 @@ export class Folders {
|
||||
absPath = join(parseWinPath(wsFolder?.fsPath || ''), folderPath);
|
||||
}
|
||||
|
||||
absPath = isWindows ? absPath.split('/').join('\\') : absPath;
|
||||
absPath = isWindows() ? absPath.split('/').join('\\') : absPath;
|
||||
return parseWinPath(absPath);
|
||||
}
|
||||
|
||||
@@ -489,14 +554,13 @@ export class Folders {
|
||||
* @returns
|
||||
*/
|
||||
private static absWsFolder(folder: ContentFolder, wsFolder?: Uri) {
|
||||
const isWindows = process.platform === 'win32';
|
||||
let absPath = folder.path.replace(WORKSPACE_PLACEHOLDER, parseWinPath(wsFolder?.fsPath || ''));
|
||||
|
||||
if (absPath.includes('../')) {
|
||||
absPath = join(absPath);
|
||||
}
|
||||
|
||||
absPath = isWindows ? absPath.split('/').join('\\') : absPath;
|
||||
absPath = isWindows() ? absPath.split('/').join('\\') : absPath;
|
||||
|
||||
return parseWinPath(absPath);
|
||||
}
|
||||
@@ -508,12 +572,11 @@ export class Folders {
|
||||
* @returns
|
||||
*/
|
||||
public static relWsFolder(folder: ContentFolder, wsFolder?: Uri) {
|
||||
const isWindows = process.platform === 'win32';
|
||||
let absPath = parseWinPath(folder.path).replace(
|
||||
parseWinPath(wsFolder?.fsPath || ''),
|
||||
WORKSPACE_PLACEHOLDER
|
||||
);
|
||||
absPath = isWindows ? absPath.split('\\').join('/') : absPath;
|
||||
absPath = isWindows() ? absPath.split('\\').join('/') : absPath;
|
||||
return absPath;
|
||||
}
|
||||
|
||||
@@ -521,9 +584,11 @@ export class Folders {
|
||||
* Find the content folders
|
||||
*/
|
||||
public static async getContentFolders() {
|
||||
Logger.verbose('Folders:getContentFolders:start');
|
||||
// Find folders that contain files
|
||||
const wsFolder = Folders.getWorkspaceFolder();
|
||||
if (!wsFolder) {
|
||||
Logger.error('Folders:getContentFolders:workspaceFolderNotFound');
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -544,7 +609,7 @@ export class Folders {
|
||||
folders = [...folders, ...(await this.findFolders(pattern))];
|
||||
} catch (e) {
|
||||
Logger.error(
|
||||
`Something went wrong while searching for folders with pattern "${pattern}": ${
|
||||
`Folders:getContentFolders:error: Something went wrong while searching for folders with pattern "${pattern}": ${
|
||||
(e as Error).message
|
||||
}`
|
||||
);
|
||||
@@ -557,6 +622,8 @@ export class Folders {
|
||||
}
|
||||
|
||||
const uniqueFolders = [...new Set(folders)];
|
||||
|
||||
Logger.verbose('Folders:getContentFolders:end');
|
||||
return uniqueFolders.map((folder) => relative(wsFolder?.path || '', folder));
|
||||
}
|
||||
|
||||
@@ -565,8 +632,8 @@ export class Folders {
|
||||
* @param folderPath
|
||||
* @returns
|
||||
*/
|
||||
public static getFilePrefixByFolderPath(folderPath: string) {
|
||||
const folders = Folders.get();
|
||||
public static async getFilePrefixByFolderPath(folderPath: string) {
|
||||
const folders = await Folders.get();
|
||||
const pageFolder = folders.find((f) => parseWinPath(f.path) === parseWinPath(folderPath));
|
||||
|
||||
if (pageFolder && typeof pageFolder.filePrefix !== 'undefined') {
|
||||
@@ -581,8 +648,8 @@ export class Folders {
|
||||
* @param filePath
|
||||
* @returns
|
||||
*/
|
||||
public static getFilePrefixBeFilePath(filePath: string) {
|
||||
const folders = Folders.get();
|
||||
public static async getFilePrefixBeFilePath(filePath: string): Promise<string | undefined> {
|
||||
const folders = await Folders.get();
|
||||
if (folders.length > 0) {
|
||||
filePath = parseWinPath(filePath);
|
||||
|
||||
@@ -604,19 +671,179 @@ export class Folders {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the page folder that matches the given file path.
|
||||
*
|
||||
* @param filePath - The file path to match against the page folders.
|
||||
* @returns The page folder that matches the file path, or undefined if no match is found.
|
||||
*/
|
||||
public static async getPageFolderByFilePath(
|
||||
filePath: string
|
||||
): Promise<ContentFolder | undefined> {
|
||||
const folders = Folders.getCached();
|
||||
const parsedPath = parseWinPath(filePath);
|
||||
const pageFolderMatches = folders
|
||||
.filter((folder) => parsedPath && folder.path && parsedPath.includes(folder.path))
|
||||
.sort((a, b) => b.path.length - a.path.length);
|
||||
|
||||
if (pageFolderMatches.length > 0 && pageFolderMatches[0]) {
|
||||
return pageFolderMatches[0];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the folder associated with the specified content type and file path.
|
||||
* If a single matching folder is found, it is returned. If multiple matching folders are found,
|
||||
* the user is prompted to select one. If no matching folders are found, the user is prompted to
|
||||
* select a folder with a preview path.
|
||||
*
|
||||
* @param contentType - The content type to match.
|
||||
* @param filePath - The file path to match.
|
||||
* @returns A Promise that resolves to the selected ContentFolder, or undefined if no matching folder is found.
|
||||
*/
|
||||
public static async getFolderByContentType(
|
||||
contentType: ContentType,
|
||||
filePath: string
|
||||
): Promise<ContentFolder | undefined> {
|
||||
if (!contentType) {
|
||||
return;
|
||||
}
|
||||
|
||||
const folders = Folders.getCached();
|
||||
let selectedFolder: ContentFolder | undefined;
|
||||
|
||||
// Try to find the folder by content type
|
||||
let crntFolders = folders.filter(
|
||||
(folder) =>
|
||||
folder.contentTypes?.includes((contentType as ContentType).name) && folder.previewPath
|
||||
);
|
||||
|
||||
// Use file path to find the folder
|
||||
if (crntFolders.length > 0) {
|
||||
crntFolders = crntFolders.filter((folder) => filePath?.startsWith(folder.path));
|
||||
}
|
||||
|
||||
if (crntFolders && crntFolders.length === 1) {
|
||||
selectedFolder = crntFolders[0];
|
||||
} else if (crntFolders && crntFolders.length > 1) {
|
||||
selectedFolder = await Preview.askUserToPickFolder(crntFolders);
|
||||
} else {
|
||||
selectedFolder = await Preview.askUserToPickFolder(folders.filter((f) => f.previewPath));
|
||||
}
|
||||
|
||||
return selectedFolder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the file stats for a given file.
|
||||
* @param file - The URI of the file.
|
||||
* @param folderPath - The path of the folder containing the file.
|
||||
* @returns An object containing the file path, file name, folder name, folder path, and file stats.
|
||||
*/
|
||||
public static async getFileStats(file: Uri, folderPath: string) {
|
||||
const fileName = basename(file.fsPath);
|
||||
const folderName = dirname(file.fsPath).split(sep).pop();
|
||||
|
||||
const stats = await workspace.fs.stat(file);
|
||||
|
||||
return {
|
||||
filePath: file.fsPath,
|
||||
fileName,
|
||||
folderName,
|
||||
folderPath,
|
||||
...stats
|
||||
};
|
||||
}
|
||||
|
||||
private static async getFilesByFolder(
|
||||
folder: ContentFolder,
|
||||
supportedFiles: string[] | undefined,
|
||||
limit?: number
|
||||
): Promise<FolderInfo | undefined> {
|
||||
try {
|
||||
const folderPath = parseWinPath(folder.path);
|
||||
const folderUri = Uri.file(folderPath);
|
||||
|
||||
if (typeof folderPath === 'string') {
|
||||
let files: Uri[] = [];
|
||||
|
||||
for (const fileType of supportedFiles || DEFAULT_FILE_TYPES) {
|
||||
let filePath = join(
|
||||
folderPath,
|
||||
folder.excludeSubdir ? '/' : '**',
|
||||
`*${fileType.startsWith('.') ? '' : '.'}${fileType}`
|
||||
);
|
||||
|
||||
if (folderPath === '' && folder.excludeSubdir) {
|
||||
filePath = `*${fileType.startsWith('.') ? '' : '.'}${fileType}`;
|
||||
}
|
||||
|
||||
let foundFiles = await Folders.findFiles(filePath);
|
||||
|
||||
// Make sure these file are coming from the folder path (this could be an issue in multi-root workspaces)
|
||||
foundFiles = foundFiles.filter((f) =>
|
||||
parseWinPath(f.fsPath).startsWith(parseWinPath(folderUri.fsPath))
|
||||
);
|
||||
|
||||
files = [...files, ...foundFiles];
|
||||
}
|
||||
|
||||
if (files) {
|
||||
let fileStats: FileInfo[] = [];
|
||||
|
||||
for (const file of files) {
|
||||
try {
|
||||
const fileInfo = await Folders.getFileStats(file, folderPath);
|
||||
fileStats.push(fileInfo);
|
||||
} catch (error) {
|
||||
// Skip the file
|
||||
}
|
||||
}
|
||||
|
||||
fileStats = fileStats.sort((a, b) => b.mtime - a.mtime);
|
||||
|
||||
if (limit) {
|
||||
fileStats = fileStats.slice(0, limit);
|
||||
}
|
||||
|
||||
return {
|
||||
title: folder.title,
|
||||
path: folderPath,
|
||||
files: files.length,
|
||||
lastModified: fileStats,
|
||||
locale: folder.locale,
|
||||
localeTitle: folder.localeTitle
|
||||
};
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// Skip the current folder
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all content folders
|
||||
* @param pattern
|
||||
* @returns
|
||||
*/
|
||||
private static findFolders(pattern: string): Promise<string[]> {
|
||||
return new Promise((resolve) => {
|
||||
glob(pattern, { ignore: '**/node_modules/**', dot: true }, (err, files) => {
|
||||
const allFolders = files.map((file) => dirname(file));
|
||||
const uniqueFolders = [...new Set(allFolders)];
|
||||
resolve(uniqueFolders);
|
||||
});
|
||||
});
|
||||
private static async findFolders(pattern: string): Promise<string[]> {
|
||||
Logger.verbose(`Folders:findFolders:start - ${pattern}`);
|
||||
|
||||
try {
|
||||
pattern = isWindows() ? parseWinPath(pattern) : pattern;
|
||||
const files = await glob(pattern, { ignore: '**/node_modules/**', dot: true });
|
||||
const allFolders = (files || []).map((file) => dirname(file));
|
||||
const uniqueFolders = [...new Set(allFolders)];
|
||||
Logger.verbose(`Folders:findFolders:end - ${uniqueFolders.length}`);
|
||||
return uniqueFolders;
|
||||
} catch (e) {
|
||||
Logger.error(`Folders:findFolders:error - ${(e as Error).message}`);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -625,11 +852,17 @@ export class Folders {
|
||||
* @returns
|
||||
*/
|
||||
private static async findFiles(pattern: string): Promise<Uri[]> {
|
||||
return new Promise((resolve) => {
|
||||
glob(pattern, { ignore: '**/node_modules/**' }, (err, files) => {
|
||||
const allFiles = files.map((file) => Uri.file(file));
|
||||
resolve(allFiles);
|
||||
});
|
||||
});
|
||||
Logger.verbose(`Folders:findFiles:start - ${pattern}`);
|
||||
|
||||
try {
|
||||
pattern = isWindows() ? parseWinPath(pattern) : pattern;
|
||||
const files = await glob(pattern, { ignore: '**/node_modules/**', dot: true });
|
||||
const allFiles = (files || []).map((file) => Uri.file(file));
|
||||
Logger.verbose(`Folders:findFiles:end - ${allFiles.length}`);
|
||||
return allFiles;
|
||||
} catch (e) {
|
||||
Logger.error(`Folders:findFiles:error - ${(e as Error).message}`);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
import { processFmPlaceholders } from './../helpers/processFmPlaceholders';
|
||||
import { processPathPlaceholders } from './../helpers/processPathPlaceholders';
|
||||
import { Telemetry } from './../helpers/Telemetry';
|
||||
import {
|
||||
SETTING_PREVIEW_HOST,
|
||||
SETTING_PREVIEW_PATHNAME,
|
||||
@@ -9,23 +6,33 @@ import {
|
||||
PreviewCommands,
|
||||
SETTING_EXPERIMENTAL,
|
||||
SETTING_DATE_FORMAT,
|
||||
GeneralCommands
|
||||
GeneralCommands,
|
||||
SETTING_PREVIEW_TRAILING_SLASH
|
||||
} from './../constants';
|
||||
import { ArticleHelper } from './../helpers/ArticleHelper';
|
||||
import { join, parse } from 'path';
|
||||
import { commands, env, Uri, ViewColumn, window, WebviewPanel, extensions } from 'vscode';
|
||||
import { Extension, parseWinPath, processKnownPlaceholders, Settings } from '../helpers';
|
||||
import {
|
||||
ArticleHelper,
|
||||
Extension,
|
||||
parseWinPath,
|
||||
processI18nPlaceholders,
|
||||
processTimePlaceholders,
|
||||
processFmPlaceholders,
|
||||
processPathPlaceholders,
|
||||
Settings,
|
||||
Telemetry,
|
||||
processDateTimePlaceholders
|
||||
} from '../helpers';
|
||||
import { ContentFolder, ContentType, PreviewSettings } from '../models';
|
||||
import { format } from 'date-fns';
|
||||
import { DateHelper } from '../helpers/DateHelper';
|
||||
import { Article } from '.';
|
||||
import { urlJoin } from 'url-join-ts';
|
||||
import { WebviewHelper } from '@estruyf/vscode';
|
||||
import { Folders } from './Folders';
|
||||
import { ParsedFrontMatter } from '../parsers';
|
||||
import { getLocalizationFile } from '../utils/getLocalizationFile';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../localization';
|
||||
import { joinUrl } from '../utils';
|
||||
import { i18n } from './i18n';
|
||||
|
||||
export class Preview {
|
||||
public static filePath: string | undefined = undefined;
|
||||
@@ -65,7 +72,7 @@ export class Preview {
|
||||
const localhostUrl = await this.getLocalServerUrl();
|
||||
|
||||
if (browserLiteCommand) {
|
||||
const pageUrl = urlJoin(localhostUrl.toString(), slug || '');
|
||||
const pageUrl = joinUrl(localhostUrl.toString(), slug || '');
|
||||
commands.executeCommand(browserLiteCommand, pageUrl);
|
||||
return;
|
||||
}
|
||||
@@ -97,6 +104,9 @@ export class Preview {
|
||||
const cspSource = webView.webview.cspSource;
|
||||
|
||||
webView.onDidDispose(() => {
|
||||
if (crntFilePath && this.webviews[crntFilePath]) {
|
||||
delete this.webviews[crntFilePath];
|
||||
}
|
||||
webView.dispose();
|
||||
});
|
||||
|
||||
@@ -174,7 +184,7 @@ export class Preview {
|
||||
<title>Front Matter Preview</title>
|
||||
</head>
|
||||
<body style="width:100%;height:100%;margin:0;padding:0;overflow:hidden">
|
||||
<div id="app" data-type="preview" data-url="${urlJoin(
|
||||
<div id="app" data-type="preview" data-url="${joinUrl(
|
||||
localhostUrl.toString(),
|
||||
slug || ''
|
||||
)}" data-isProd="${isProd}" data-environment="${
|
||||
@@ -196,7 +206,7 @@ export class Preview {
|
||||
* @param filePath
|
||||
* @param slug
|
||||
*/
|
||||
public static async updatePageUrl(filePath: string, slug?: string) {
|
||||
public static async updatePageUrl(filePath: string, _: string) {
|
||||
const webView = this.webviews[filePath];
|
||||
if (webView) {
|
||||
const localhost = await this.getLocalServerUrl();
|
||||
@@ -205,7 +215,7 @@ export class Preview {
|
||||
|
||||
webView.webview.postMessage({
|
||||
command: PreviewCommands.toWebview.updateUrl,
|
||||
payload: urlJoin(localhost.toString(), slug || '')
|
||||
payload: joinUrl(localhost.toString(), slug || '')
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -234,47 +244,18 @@ export class Preview {
|
||||
|
||||
let contentType: ContentType | undefined = undefined;
|
||||
if (article?.data) {
|
||||
contentType = ArticleHelper.getContentType(article);
|
||||
contentType = await ArticleHelper.getContentType(article);
|
||||
}
|
||||
|
||||
// Check if there is a pathname defined on content folder level
|
||||
const folders = Folders.get();
|
||||
if (folders.length > 0) {
|
||||
const foldersWithPath = folders.filter((folder) => folder.previewPath);
|
||||
// Get the folder of the article by the file path
|
||||
selectedFolder = await Folders.getPageFolderByFilePath(filePath);
|
||||
|
||||
for (const folder of foldersWithPath) {
|
||||
const folderPath = parseWinPath(folder.path);
|
||||
if (filePath.startsWith(folderPath)) {
|
||||
if (!selectedFolder || selectedFolder.path.length < folderPath.length) {
|
||||
selectedFolder = folder;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!selectedFolder && contentType) {
|
||||
selectedFolder = await Folders.getFolderByContentType(contentType, filePath);
|
||||
}
|
||||
|
||||
if (!selectedFolder && article?.data && contentType && !contentType.previewPath) {
|
||||
// Try to find the folder by content type
|
||||
let crntFolders = folders.filter(
|
||||
(folder) =>
|
||||
folder.contentTypes?.includes((contentType as ContentType).name) && folder.previewPath
|
||||
);
|
||||
|
||||
// Use file path to find the folder
|
||||
if (crntFolders.length > 0) {
|
||||
crntFolders = crntFolders.filter((folder) => filePath?.startsWith(folder.path));
|
||||
}
|
||||
|
||||
if (crntFolders && crntFolders.length === 1) {
|
||||
selectedFolder = crntFolders[0];
|
||||
} else if (crntFolders && crntFolders.length > 1) {
|
||||
selectedFolder = await Preview.askUserToPickFolder(crntFolders);
|
||||
} else {
|
||||
selectedFolder = await Preview.askUserToPickFolder(folders.filter((f) => f.previewPath));
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedFolder && selectedFolder.previewPath) {
|
||||
pathname = selectedFolder.previewPath;
|
||||
}
|
||||
if (selectedFolder && selectedFolder.previewPath) {
|
||||
pathname = selectedFolder.previewPath;
|
||||
}
|
||||
|
||||
// Check if there is a pathname defined on content type level
|
||||
@@ -285,13 +266,18 @@ export class Preview {
|
||||
}
|
||||
|
||||
if (!slug) {
|
||||
slug = Article.getSlug();
|
||||
slug = Article.getSlug(pathname);
|
||||
}
|
||||
|
||||
const locale = await i18n.getLocale(filePath);
|
||||
if (locale && locale.path === slug) {
|
||||
slug = '';
|
||||
}
|
||||
|
||||
if (pathname) {
|
||||
// Known placeholders
|
||||
const dateFormat = Settings.get(SETTING_DATE_FORMAT) as string;
|
||||
pathname = processKnownPlaceholders(pathname, article?.data?.title, dateFormat);
|
||||
pathname = processTimePlaceholders(pathname, dateFormat);
|
||||
|
||||
// Custom placeholders
|
||||
pathname = await ArticleHelper.processCustomPlaceholders(
|
||||
@@ -307,22 +293,27 @@ export class Preview {
|
||||
const folderPath = wsFolder ? parseWinPath(wsFolder.fsPath) : '';
|
||||
const relativePath = filePath.replace(folderPath, '');
|
||||
pathname = processPathPlaceholders(pathname, relativePath, filePath, selectedFolder);
|
||||
pathname = processI18nPlaceholders(pathname, selectedFolder);
|
||||
|
||||
const file = parse(filePath);
|
||||
if (file.name.toLowerCase() === 'index' && pathname.endsWith(slug)) {
|
||||
slug = '';
|
||||
if (file.name.toLowerCase() === 'index') {
|
||||
const cleanPathName = pathname.endsWith('/')
|
||||
? pathname.substring(0, pathname.length - 1)
|
||||
: pathname;
|
||||
|
||||
if (cleanPathName.endsWith(slug) || !pathname || pathname === '/') {
|
||||
slug = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Support front matter placeholders - {{fm.<field>}}
|
||||
pathname = processFmPlaceholders(pathname, article?.data);
|
||||
pathname = article?.data ? processFmPlaceholders(pathname, article?.data) : pathname;
|
||||
|
||||
try {
|
||||
const articleDate = ArticleHelper.getDate(article);
|
||||
slug = join(
|
||||
format(articleDate || new Date(), DateHelper.formatUpdate(pathname) as string),
|
||||
slug
|
||||
);
|
||||
const articleDate = await ArticleHelper.getDate(article);
|
||||
pathname = processDateTimePlaceholders(pathname, dateFormat, articleDate);
|
||||
slug = join(pathname, slug);
|
||||
} catch (error) {
|
||||
slug = join(pathname, slug);
|
||||
}
|
||||
@@ -336,7 +327,25 @@ export class Preview {
|
||||
slug = slug.substring(0, slug.endsWith('_index') ? slug.length - 6 : slug.length - 5);
|
||||
}
|
||||
|
||||
return slug;
|
||||
// Add the trailing slash
|
||||
let trailingSlash = false;
|
||||
if (settings.trailingSlash !== undefined) {
|
||||
trailingSlash = settings.trailingSlash;
|
||||
}
|
||||
|
||||
if (selectedFolder && selectedFolder.trailingSlash !== undefined) {
|
||||
trailingSlash = selectedFolder.trailingSlash;
|
||||
}
|
||||
|
||||
if (contentType && contentType.trailingSlash !== undefined) {
|
||||
trailingSlash = contentType.trailingSlash;
|
||||
}
|
||||
|
||||
if (trailingSlash && !slug.endsWith('/')) {
|
||||
slug = `${slug}/`;
|
||||
}
|
||||
|
||||
return join(slug);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -372,10 +381,12 @@ export class Preview {
|
||||
public static getSettings(): PreviewSettings {
|
||||
const host = Settings.get<string>(SETTING_PREVIEW_HOST);
|
||||
const pathname = Settings.get<string>(SETTING_PREVIEW_PATHNAME);
|
||||
const trailingSlash = Settings.get<boolean>(SETTING_PREVIEW_TRAILING_SLASH);
|
||||
|
||||
return {
|
||||
host,
|
||||
pathname
|
||||
pathname,
|
||||
trailingSlash
|
||||
};
|
||||
}
|
||||
|
||||
@@ -384,7 +395,7 @@ export class Preview {
|
||||
* @param crntFolders
|
||||
* @returns
|
||||
*/
|
||||
private static async askUserToPickFolder(
|
||||
public static async askUserToPickFolder(
|
||||
crntFolders: ContentFolder[]
|
||||
): Promise<ContentFolder | undefined> {
|
||||
let selectedFolder: ContentFolder | undefined = undefined;
|
||||
|
||||
@@ -42,6 +42,25 @@ categories: []
|
||||
const ext = Extension.getInstance();
|
||||
const subscriptions = ext.subscriptions;
|
||||
|
||||
// Initialize command
|
||||
subscriptions.push(
|
||||
commands.registerCommand(COMMAND_NAME.init, async (cb: Function) => {
|
||||
await Project.init();
|
||||
|
||||
if (cb) {
|
||||
cb();
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
subscriptions.push(
|
||||
commands.registerCommand(COMMAND_NAME.initTemplate, () => Project.createSampleTemplate(true))
|
||||
);
|
||||
|
||||
subscriptions.push(commands.registerCommand(COMMAND_NAME.registerFolder, Folders.register));
|
||||
subscriptions.push(commands.registerCommand(COMMAND_NAME.unregisterFolder, Folders.unregister));
|
||||
subscriptions.push(commands.registerCommand(COMMAND_NAME.createFolder, Folders.addMediaFolder));
|
||||
|
||||
subscriptions.push(commands.registerCommand(COMMAND_NAME.switchProject, Project.switchProject));
|
||||
}
|
||||
|
||||
@@ -63,7 +82,7 @@ categories: []
|
||||
await Settings.createTeamSettings();
|
||||
|
||||
// Add the default content type
|
||||
await Settings.update(SETTING_TAXONOMY_CONTENT_TYPES, [DEFAULT_CONTENT_TYPE], true);
|
||||
await Settings.safeUpdate(SETTING_TAXONOMY_CONTENT_TYPES, [DEFAULT_CONTENT_TYPE], true);
|
||||
|
||||
if (sampleTemplate !== undefined) {
|
||||
await Project.createSampleTemplate();
|
||||
|
||||
@@ -1,14 +1,37 @@
|
||||
import { TaxonomyHelper } from './../helpers/TaxonomyHelper';
|
||||
import * as vscode from 'vscode';
|
||||
import { TaxonomyType } from '../models';
|
||||
import { EXTENSION_NAME } from '../constants';
|
||||
import { ArticleHelper, FilesHelper } from '../helpers';
|
||||
import { COMMAND_NAME, EXTENSION_NAME } from '../constants';
|
||||
import { ArticleHelper, Extension, FilesHelper } from '../helpers';
|
||||
import { FrontMatterParser } from '../parsers';
|
||||
import { Notifications } from '../helpers/Notifications';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../localization';
|
||||
|
||||
export class Settings {
|
||||
public static async registerCommands() {
|
||||
const ext = Extension.getInstance();
|
||||
const subscriptions = ext.subscriptions;
|
||||
|
||||
subscriptions.push(
|
||||
vscode.commands.registerCommand(COMMAND_NAME.createTag, () => {
|
||||
Settings.create(TaxonomyType.Tag);
|
||||
})
|
||||
);
|
||||
|
||||
subscriptions.push(
|
||||
vscode.commands.registerCommand(COMMAND_NAME.createCategory, () => {
|
||||
Settings.create(TaxonomyType.Category);
|
||||
})
|
||||
);
|
||||
|
||||
subscriptions.push(
|
||||
vscode.commands.registerCommand(COMMAND_NAME.exportTaxonomy, Settings.export)
|
||||
);
|
||||
|
||||
subscriptions.push(vscode.commands.registerCommand(COMMAND_NAME.remap, Settings.remap));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new taxonomy
|
||||
*
|
||||
@@ -18,13 +41,13 @@ export class Settings {
|
||||
const taxonomy = type === TaxonomyType.Tag ? 'tag' : 'category';
|
||||
|
||||
const newOption = await vscode.window.showInputBox({
|
||||
prompt: l10n.t(LocalizationKey.commandsFoldersCreateInputPrompt, taxonomy),
|
||||
placeHolder: l10n.t(LocalizationKey.commandsFoldersCreateInputPlaceholder, taxonomy),
|
||||
prompt: l10n.t(LocalizationKey.commandsSettingsCreateInputPrompt, taxonomy),
|
||||
placeHolder: l10n.t(LocalizationKey.commandsSettingsCreateInputPlaceholder, taxonomy),
|
||||
ignoreFocusOut: true
|
||||
});
|
||||
|
||||
if (newOption) {
|
||||
let options = (await TaxonomyHelper.get(type)) || [];
|
||||
const options = (await TaxonomyHelper.get(type)) || [];
|
||||
|
||||
if (options.find((o) => o === newOption)) {
|
||||
Notifications.warning(l10n.t(LocalizationKey.commandsSettingsCreateWarning, taxonomy));
|
||||
|
||||
@@ -19,6 +19,7 @@ import { Field } from '../models';
|
||||
import { Preview } from './Preview';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../localization';
|
||||
import { i18n } from './i18n';
|
||||
|
||||
export class StatusListener {
|
||||
/**
|
||||
@@ -42,6 +43,10 @@ export class StatusListener {
|
||||
try {
|
||||
commands.executeCommand('setContext', CONTEXT.isValidFile, true);
|
||||
|
||||
// Check i18n
|
||||
const isI18nEnabled = await i18n.isLocaleEnabled(document.uri.fsPath);
|
||||
commands.executeCommand('setContext', CONTEXT.isI18nEnabled, isI18nEnabled);
|
||||
|
||||
const article = editor
|
||||
? ArticleHelper.getFrontMatter(editor)
|
||||
: await ArticleHelper.getFrontMatterByPath(document.uri.fsPath);
|
||||
@@ -83,6 +88,7 @@ export class StatusListener {
|
||||
}
|
||||
} else {
|
||||
commands.executeCommand('setContext', CONTEXT.isValidFile, false);
|
||||
commands.executeCommand('setContext', CONTEXT.isI18nEnabled, false);
|
||||
|
||||
const panel = PanelProvider.getInstance();
|
||||
if (panel && panel.visible) {
|
||||
@@ -96,13 +102,13 @@ export class StatusListener {
|
||||
* @param article
|
||||
* @param collection
|
||||
*/
|
||||
private static verifyRequiredFields(
|
||||
private static async verifyRequiredFields(
|
||||
editor: vscode.TextEditor,
|
||||
article: ParsedFrontMatter,
|
||||
collection: vscode.DiagnosticCollection
|
||||
) {
|
||||
// Check for missing fields
|
||||
const emptyFields = ContentType.findEmptyRequiredFields(article);
|
||||
const emptyFields = await ContentType.findEmptyRequiredFields(article);
|
||||
const fieldsToReport = [];
|
||||
|
||||
if (emptyFields && emptyFields.length > 0) {
|
||||
|
||||
@@ -2,12 +2,13 @@ import { Questions } from './../helpers/Questions';
|
||||
import * as vscode from 'vscode';
|
||||
import * as path from 'path';
|
||||
import {
|
||||
COMMAND_NAME,
|
||||
SETTING_CONTENT_DEFAULT_FILETYPE,
|
||||
SETTING_TEMPLATES_FOLDER,
|
||||
TelemetryEvent
|
||||
} from '../constants';
|
||||
import { ArticleHelper, Settings } from '../helpers';
|
||||
import { Article } from '.';
|
||||
import { ArticleHelper, Extension, Settings } from '../helpers';
|
||||
import { Article, Folders } from '.';
|
||||
import { Notifications } from '../helpers/Notifications';
|
||||
import { Project } from './Project';
|
||||
import { ContentType } from '../helpers/ContentType';
|
||||
@@ -20,6 +21,24 @@ import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../localization';
|
||||
|
||||
export class Template {
|
||||
public static async registerCommands() {
|
||||
const ext = Extension.getInstance();
|
||||
const subscriptions = ext.subscriptions;
|
||||
|
||||
subscriptions.push(
|
||||
vscode.commands.registerCommand(COMMAND_NAME.createTemplate, Template.generate)
|
||||
);
|
||||
|
||||
subscriptions.push(
|
||||
vscode.commands.registerCommand(COMMAND_NAME.createFromTemplate, (folder: vscode.Uri) => {
|
||||
const folderPath = Folders.getFolderPath(folder);
|
||||
if (folderPath) {
|
||||
Template.create(folderPath);
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a template
|
||||
*/
|
||||
@@ -163,7 +182,7 @@ export class Template {
|
||||
await copyFileAsync(template.fsPath, newFilePath);
|
||||
|
||||
// Update the properties inside the template
|
||||
let frontMatter = await ArticleHelper.getFrontMatterByPath(newFilePath);
|
||||
const frontMatter = await ArticleHelper.getFrontMatterByPath(newFilePath);
|
||||
if (!frontMatter) {
|
||||
Notifications.warning(l10n.t(LocalizationKey.commonError));
|
||||
return;
|
||||
@@ -176,7 +195,7 @@ export class Template {
|
||||
newFilePath
|
||||
);
|
||||
|
||||
const article = Article.updateDate(frontMatter);
|
||||
const article = await Article.updateDate(frontMatter);
|
||||
|
||||
if (!article) {
|
||||
return;
|
||||
|
||||
564
src/commands/i18n.ts
Normal file
@@ -0,0 +1,564 @@
|
||||
import { ProgressLocation, Uri, commands, window, workspace } from 'vscode';
|
||||
import {
|
||||
ArticleHelper,
|
||||
ContentType,
|
||||
Extension,
|
||||
FrameworkDetector,
|
||||
Notifications,
|
||||
Settings,
|
||||
openFileInEditor,
|
||||
parseWinPath
|
||||
} from '../helpers';
|
||||
import { COMMAND_NAME, SETTING_CONTENT_I18N } from '../constants';
|
||||
import { ContentFolder, Field, I18nConfig, ContentType as IContentType } from '../models';
|
||||
import { join, parse } from 'path';
|
||||
import { existsAsync } from '../utils';
|
||||
import { Folders } from '.';
|
||||
import { ParsedFrontMatter } from '../parsers';
|
||||
import { PagesListener } from '../listeners/dashboard';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../localization';
|
||||
import { Translations } from '../services/Translations';
|
||||
|
||||
export class i18n {
|
||||
private static processedFiles: {
|
||||
[filePath: string]: { dir: string; filename: string; isPageBundle: boolean };
|
||||
} = {};
|
||||
|
||||
/**
|
||||
* Registers the i18n commands.
|
||||
*/
|
||||
public static register() {
|
||||
const subscriptions = Extension.getInstance().subscriptions;
|
||||
|
||||
subscriptions.push(commands.registerCommand(COMMAND_NAME.i18n.create, i18n.create));
|
||||
|
||||
i18n.clearFiles();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the processed files
|
||||
*/
|
||||
public static clearFiles() {
|
||||
i18n.processedFiles = {};
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all the I18nConfig settings.
|
||||
*
|
||||
* @returns An array of I18nConfig settings.
|
||||
*/
|
||||
public static async getAll() {
|
||||
const i18nSettings = Settings.get<I18nConfig[]>(SETTING_CONTENT_I18N) || [];
|
||||
|
||||
const folders = await Folders.get();
|
||||
if (folders) {
|
||||
for (const folder of folders) {
|
||||
if (folder.locales) {
|
||||
for (const locale of folder.locales) {
|
||||
if (!i18nSettings.some((i18n) => i18n.locale === locale.locale)) {
|
||||
i18nSettings.push(locale);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return i18nSettings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the I18nConfig settings from the application.
|
||||
* @returns An array of I18nConfig objects if settings are found, otherwise undefined.
|
||||
*/
|
||||
public static async getSettings(filePath: string): Promise<I18nConfig[] | undefined> {
|
||||
if (!filePath) {
|
||||
return;
|
||||
}
|
||||
|
||||
const i18nSettings = Settings.get<I18nConfig[]>(SETTING_CONTENT_I18N);
|
||||
let pageFolder = await Folders.getPageFolderByFilePath(filePath);
|
||||
if (!pageFolder) {
|
||||
pageFolder = await i18n.getPageFolder(filePath);
|
||||
}
|
||||
|
||||
if (!pageFolder || !pageFolder.locales) {
|
||||
return i18nSettings;
|
||||
}
|
||||
|
||||
return pageFolder.locales;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the locale is enabled for the given file path.
|
||||
* @param filePath - The file path to check.
|
||||
* @returns A promise that resolves to a boolean indicating whether the locale is enabled or not.
|
||||
*/
|
||||
public static async isLocaleEnabled(filePath: string): Promise<boolean> {
|
||||
const i18nSettings = await i18n.getSettings(filePath);
|
||||
if (!i18nSettings) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const pageFolder = await Folders.getPageFolderByFilePath(filePath);
|
||||
if (!pageFolder || !pageFolder.locale) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return i18nSettings.some((i18n) => i18n.locale === pageFolder.locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given file path corresponds to the default language.
|
||||
* @param filePath - The file path to check.
|
||||
* @returns True if the file path corresponds to the default language, false otherwise.
|
||||
*/
|
||||
public static async isDefaultLanguage(filePath: string): Promise<boolean> {
|
||||
const i18nSettings = await i18n.getSettings(filePath);
|
||||
if (!i18nSettings) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const pageFolder = await Folders.getPageFolderByFilePath(filePath);
|
||||
if (!pageFolder || !pageFolder.defaultLocale) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const fileInfo = await i18n.getFileInfo(filePath);
|
||||
|
||||
if (pageFolder.path) {
|
||||
if (pageFolder.locale) {
|
||||
return pageFolder.locale === pageFolder.defaultLocale;
|
||||
}
|
||||
|
||||
let pageFolderPath = parseWinPath(pageFolder.path);
|
||||
if (!pageFolderPath.endsWith('/')) {
|
||||
pageFolderPath += '/';
|
||||
}
|
||||
|
||||
return (
|
||||
parseWinPath(fileInfo.dir).toLowerCase() === parseWinPath(pageFolderPath).toLowerCase()
|
||||
);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the I18nConfig for a given file path.
|
||||
* @param filePath - The path of the file.
|
||||
* @returns The I18nConfig object if found, otherwise undefined.
|
||||
*/
|
||||
public static async getLocale(filePath: string): Promise<I18nConfig | undefined> {
|
||||
const i18nSettings = await i18n.getSettings(filePath);
|
||||
if (!i18nSettings) {
|
||||
return;
|
||||
}
|
||||
|
||||
let pageFolder = await Folders.getPageFolderByFilePath(filePath);
|
||||
|
||||
const fileInfo = await i18n.getFileInfo(filePath);
|
||||
|
||||
if (pageFolder && pageFolder.defaultLocale) {
|
||||
let pageFolderPath = parseWinPath(pageFolder.path);
|
||||
if (!pageFolderPath.endsWith('/')) {
|
||||
pageFolderPath += '/';
|
||||
}
|
||||
|
||||
if (
|
||||
pageFolder.path &&
|
||||
pageFolder.locale &&
|
||||
parseWinPath(fileInfo.dir).toLowerCase() === parseWinPath(pageFolderPath).toLowerCase()
|
||||
) {
|
||||
return i18nSettings.find((i18n) => i18n.locale === pageFolder?.locale);
|
||||
}
|
||||
}
|
||||
|
||||
pageFolder = await i18n.getPageFolder(filePath);
|
||||
if (!pageFolder) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const locale of i18nSettings) {
|
||||
if (locale.path && pageFolder.defaultLocale !== locale.locale) {
|
||||
const translation = join(pageFolder.path, locale.path, fileInfo.filename);
|
||||
if (parseWinPath(translation).toLowerCase() === parseWinPath(filePath).toLowerCase()) {
|
||||
return locale;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves translations for a given file path.
|
||||
* @param filePath - The path of the file for which translations are requested.
|
||||
* @returns A promise that resolves to an object containing translations for each locale, or undefined if i18n settings are not available.
|
||||
*/
|
||||
public static async getTranslations(filePath: string): Promise<
|
||||
| {
|
||||
[locale: string]: {
|
||||
locale: I18nConfig;
|
||||
path: string;
|
||||
};
|
||||
}
|
||||
| undefined
|
||||
> {
|
||||
const i18nSettings = await i18n.getSettings(filePath);
|
||||
if (!i18nSettings) {
|
||||
return;
|
||||
}
|
||||
|
||||
const translations: {
|
||||
[locale: string]: {
|
||||
locale: I18nConfig;
|
||||
path: string;
|
||||
};
|
||||
} = {};
|
||||
|
||||
let pageFolder = await Folders.getPageFolderByFilePath(filePath);
|
||||
const fileInfo = await i18n.getFileInfo(filePath);
|
||||
|
||||
if (pageFolder && pageFolder.defaultLocale && pageFolder.localeSourcePath) {
|
||||
for (const i18n of i18nSettings) {
|
||||
const translation = join(pageFolder.localeSourcePath, i18n.path || '', fileInfo.filename);
|
||||
if (await existsAsync(translation)) {
|
||||
translations[i18n.locale] = {
|
||||
locale: i18n,
|
||||
path: translation
|
||||
};
|
||||
}
|
||||
}
|
||||
return translations;
|
||||
}
|
||||
|
||||
pageFolder = await i18n.getPageFolder(filePath);
|
||||
if (!pageFolder) {
|
||||
return translations;
|
||||
}
|
||||
|
||||
for (const i18n of i18nSettings) {
|
||||
const translation = join(pageFolder.path, i18n.path || '', fileInfo.filename);
|
||||
if (await existsAsync(translation)) {
|
||||
translations[i18n.locale] = {
|
||||
locale: i18n,
|
||||
path: translation
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return translations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new content file for a specific locale based on the i18n configuration.
|
||||
* If a file path is provided, the new content file will be created in the same directory.
|
||||
* If no file path is provided, the active file in the editor will be used.
|
||||
* @param filePath The path of the file where the new content file should be created.
|
||||
*/
|
||||
private static async create(fileUri?: Uri | string) {
|
||||
if (!fileUri) {
|
||||
const filePath = ArticleHelper.getActiveFile();
|
||||
fileUri = filePath ? Uri.file(filePath) : undefined;
|
||||
}
|
||||
|
||||
if (!fileUri) {
|
||||
Notifications.warning(l10n.t(LocalizationKey.commandsI18nCreateWarningNoFileSelected));
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof fileUri === 'string') {
|
||||
fileUri = Uri.file(fileUri);
|
||||
}
|
||||
|
||||
const pageFolder = await Folders.getPageFolderByFilePath(fileUri.fsPath);
|
||||
if (!pageFolder || !pageFolder.localeSourcePath) {
|
||||
Notifications.error(l10n.t(LocalizationKey.commandsI18nCreateErrorNoContentFolder));
|
||||
return;
|
||||
}
|
||||
|
||||
const i18nSettings = await i18n.getSettings(fileUri.fsPath);
|
||||
if (!i18nSettings) {
|
||||
Notifications.warning(l10n.t(LocalizationKey.commandsI18nCreateWarningNoConfig));
|
||||
return;
|
||||
}
|
||||
|
||||
const sourceLocale = await i18n.getLocale(fileUri.fsPath);
|
||||
if (!sourceLocale || !sourceLocale.locale) {
|
||||
Notifications.warning(l10n.t(LocalizationKey.commandsI18nCreateErrorNoLocaleDefinition));
|
||||
return;
|
||||
}
|
||||
|
||||
const translations = (await i18n.getTranslations(fileUri.fsPath)) || {};
|
||||
const targetLocales = i18nSettings.filter((i18nSetting) => {
|
||||
return (
|
||||
i18nSetting.path &&
|
||||
i18nSetting.locale !== sourceLocale.locale &&
|
||||
!translations[i18nSetting.locale]
|
||||
);
|
||||
});
|
||||
|
||||
if (targetLocales.length === 0) {
|
||||
Notifications.warning(l10n.t(LocalizationKey.commandsI18nCreateErrorNoLocales));
|
||||
return;
|
||||
}
|
||||
|
||||
const locale = await window.showQuickPick(
|
||||
targetLocales.map((i18n) => i18n.title || i18n.locale),
|
||||
{
|
||||
title: l10n.t(LocalizationKey.commandsI18nCreateQuickPickTitle),
|
||||
placeHolder: l10n.t(LocalizationKey.commandsI18nCreateQuickPickPlaceHolder),
|
||||
ignoreFocusOut: true
|
||||
}
|
||||
);
|
||||
|
||||
if (!locale) {
|
||||
return;
|
||||
}
|
||||
|
||||
const targetLocale = i18nSettings.find(
|
||||
(i18n) => i18n.title === locale || i18n.locale === locale
|
||||
);
|
||||
if (!targetLocale || !targetLocale.path) {
|
||||
Notifications.warning(l10n.t(LocalizationKey.commandsI18nCreateWarningNoConfig));
|
||||
return;
|
||||
}
|
||||
|
||||
let article = await ArticleHelper.getFrontMatterByPath(fileUri.fsPath);
|
||||
if (!article) {
|
||||
Notifications.warning(l10n.t(LocalizationKey.commandsI18nCreateWarningNoFile));
|
||||
return;
|
||||
}
|
||||
|
||||
const contentType = await ArticleHelper.getContentType(article);
|
||||
if (!contentType) {
|
||||
Notifications.warning(l10n.t(LocalizationKey.commandsI18nCreateWarningNoContentType));
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the directory of the file
|
||||
const fileInfo = parse(fileUri.fsPath);
|
||||
let dir = fileInfo.dir;
|
||||
let pageBundleDir = '';
|
||||
|
||||
if (await ArticleHelper.isPageBundle(fileUri.fsPath)) {
|
||||
dir = ArticleHelper.getPageFolderFromBundlePath(fileUri.fsPath);
|
||||
pageBundleDir = fileUri.fsPath.replace(dir, '');
|
||||
pageBundleDir = join(parse(pageBundleDir).dir);
|
||||
}
|
||||
|
||||
const i18nDir = join(pageFolder.localeSourcePath, targetLocale.path, pageBundleDir);
|
||||
|
||||
if (!(await existsAsync(i18nDir))) {
|
||||
await workspace.fs.createDirectory(Uri.file(i18nDir));
|
||||
}
|
||||
|
||||
article = await i18n.updateFrontMatter(
|
||||
article,
|
||||
fileUri.fsPath,
|
||||
contentType,
|
||||
sourceLocale,
|
||||
targetLocale,
|
||||
i18nDir
|
||||
);
|
||||
|
||||
const newFilePath = join(i18nDir, fileInfo.base);
|
||||
if (await existsAsync(newFilePath)) {
|
||||
Notifications.error(l10n.t(LocalizationKey.commandsI18nCreateErrorFileExists));
|
||||
return;
|
||||
}
|
||||
|
||||
if (sourceLocale?.locale) {
|
||||
article = await i18n.translate(article, sourceLocale, targetLocale);
|
||||
}
|
||||
|
||||
const newFileUri = Uri.file(newFilePath);
|
||||
await workspace.fs.writeFile(
|
||||
newFileUri,
|
||||
Buffer.from(ArticleHelper.stringifyFrontMatter(article.content, article.data))
|
||||
);
|
||||
|
||||
await openFileInEditor(newFilePath);
|
||||
|
||||
PagesListener.refresh();
|
||||
|
||||
Notifications.info(
|
||||
l10n.t(
|
||||
LocalizationKey.commandsI18nCreateSuccessCreated,
|
||||
sourceLocale.title || sourceLocale.locale
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Translates the given article from the source locale to the target locale using DeepL translation service.
|
||||
* @param article - The article to be translated.
|
||||
* @param sourceLocale - The source locale configuration.
|
||||
* @param targetLocale - The target locale configuration.
|
||||
* @returns A promise that resolves to the translated article.
|
||||
*/
|
||||
private static async translate(
|
||||
article: ParsedFrontMatter,
|
||||
sourceLocale: I18nConfig,
|
||||
targetLocale: I18nConfig
|
||||
) {
|
||||
return new Promise<ParsedFrontMatter>(async (resolve) => {
|
||||
await window.withProgress(
|
||||
{
|
||||
location: ProgressLocation.Notification,
|
||||
title: l10n.t(LocalizationKey.commandsI18nTranslateProgressTitle),
|
||||
cancellable: false
|
||||
},
|
||||
async () => {
|
||||
try {
|
||||
const title = article.data.title || '';
|
||||
const description = article.data.description || '';
|
||||
const content = article.content || '';
|
||||
|
||||
const text = [title, description, content];
|
||||
const translations = await Translations.translate(
|
||||
text,
|
||||
sourceLocale.locale,
|
||||
targetLocale.locale
|
||||
);
|
||||
|
||||
if (!translations || translations.length < 3) {
|
||||
resolve(article);
|
||||
return;
|
||||
}
|
||||
|
||||
article.data.title = article.data.title ? translations[0] : '';
|
||||
article.data.description = article.data.description ? translations[1] : '';
|
||||
article.content = article.content ? translations[2] : '';
|
||||
} catch (error) {
|
||||
Notifications.error(`${(error as Error).message}`);
|
||||
}
|
||||
|
||||
resolve(article);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the filename and directory information from the given file path.
|
||||
* If the file is a page bundle, the directory will be adjusted accordingly.
|
||||
* @param filePath - The path of the file.
|
||||
* @returns An object containing the filename and directory.
|
||||
*/
|
||||
private static async getFileInfo(filePath: string): Promise<{ filename: string; dir: string }> {
|
||||
if (i18n.processedFiles[filePath]) {
|
||||
return i18n.processedFiles[filePath];
|
||||
}
|
||||
|
||||
const fileInfo = parse(filePath);
|
||||
let filename = fileInfo.base;
|
||||
let dir = fileInfo.dir;
|
||||
|
||||
const isPageBundle = await ArticleHelper.isPageBundle(filePath);
|
||||
if (isPageBundle) {
|
||||
dir = ArticleHelper.getPageFolderFromBundlePath(filePath);
|
||||
filename = join(parseWinPath(filePath).replace(parseWinPath(dir), ''));
|
||||
}
|
||||
|
||||
if (!dir.endsWith('/')) {
|
||||
dir += '/';
|
||||
}
|
||||
|
||||
i18n.processedFiles[filePath] = {
|
||||
isPageBundle,
|
||||
filename,
|
||||
dir
|
||||
};
|
||||
|
||||
return i18n.processedFiles[filePath];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the page folder for a given file path.
|
||||
*
|
||||
* @param filePath - The path of the file.
|
||||
* @returns A promise that resolves to the ContentFolder object representing the page folder, or undefined if not found.
|
||||
*/
|
||||
private static async getPageFolder(filePath: string): Promise<ContentFolder | undefined> {
|
||||
const folders = await Folders.get();
|
||||
|
||||
const localeFolders = folders?.filter((folder) => folder.defaultLocale);
|
||||
if (!localeFolders) {
|
||||
return;
|
||||
}
|
||||
|
||||
const fileInfo = await i18n.getFileInfo(filePath);
|
||||
|
||||
for (const folder of localeFolders) {
|
||||
const defaultFile = join(folder.path, fileInfo.filename);
|
||||
if (await existsAsync(defaultFile)) {
|
||||
return folder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the front matter of an article with internationalization (i18n) support.
|
||||
*
|
||||
* @param article - The parsed front matter of the article.
|
||||
* @param filePath - The path of the file containing the front matter.
|
||||
* @param contentType - The content type of the article.
|
||||
* @param sourceLocale - The source locale.
|
||||
* @param targetLocale - The target locale.
|
||||
* @param i18nDir - The directory where the i18n files are located.
|
||||
* @returns A Promise that resolves to the updated parsed front matter.
|
||||
*/
|
||||
private static async updateFrontMatter(
|
||||
article: ParsedFrontMatter,
|
||||
filePath: string,
|
||||
contentType: IContentType,
|
||||
sourceLocale: I18nConfig,
|
||||
targetLocale: I18nConfig,
|
||||
i18nDir: string
|
||||
): Promise<ParsedFrontMatter> {
|
||||
const imageFields = ContentType.findFieldsByTypeDeep(contentType.fields, 'image');
|
||||
if (imageFields.length > 0) {
|
||||
article.data = await i18n.processImageFields(article.data, filePath, imageFields, i18nDir);
|
||||
}
|
||||
|
||||
return article;
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the image fields in the provided data object.
|
||||
* Replaces the image field values with the relative path to the image file.
|
||||
*
|
||||
* @param data - The data object containing the field values.
|
||||
* @param filePath - The absolute file path of the data object.
|
||||
* @param fields - The array of field arrays to process.
|
||||
* @param i18nDir - The directory path for internationalization.
|
||||
* @returns The updated data object with image field values replaced by relative paths.
|
||||
*/
|
||||
private static async processImageFields(
|
||||
data: { [key: string]: any },
|
||||
filePath: string,
|
||||
fields: Field[][],
|
||||
i18nDir: string
|
||||
) {
|
||||
for (const field of fields) {
|
||||
if (!field) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const f of field) {
|
||||
if (f.type === 'image') {
|
||||
const value = data[f.name];
|
||||
if (value) {
|
||||
let imgPath = FrameworkDetector.getAbsPathByFile(value, filePath);
|
||||
imgPath = FrameworkDetector.getRelPathByFileDir(imgPath, i18nDir);
|
||||
data[f.name] = imgPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ export const FeatureFlag: React.FunctionComponent<IFeatureFlagProps> = ({
|
||||
alternative,
|
||||
children
|
||||
}: React.PropsWithChildren<IFeatureFlagProps>) => {
|
||||
if (!features || (features.length > 0 && !features.includes(flag))) {
|
||||
if (!features || features.length === 0 || (features.length > 0 && !features.includes(flag))) {
|
||||
if (alternative) {
|
||||
return alternative;
|
||||
}
|
||||
|
||||
13
src/components/icons/ArrowClockwiseIcon.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import * as React from 'react';
|
||||
|
||||
export interface IArrowClockwiseIconProps {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const ArrowClockwiseIcon: React.FunctionComponent<IArrowClockwiseIconProps> = ({ className }: React.PropsWithChildren<IArrowClockwiseIconProps>) => {
|
||||
return (
|
||||
<svg className={className || 'h-4 w-4'} fill="currentColor" aria-hidden="true" width="1em" height="1em" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M3.07 9.05a7 7 0 0 1 12.55-3.22l.13.17H12.5a.5.5 0 1 0 0 1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 0-1 0v2.2a8 8 0 1 0 1.99 4.77.5.5 0 0 0-1 .08 7 7 0 1 1-13.92-.5Z" fill="currentColor"></path>
|
||||
</svg>
|
||||
);
|
||||
};
|
||||
13
src/components/icons/RenameIcon.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import * as React from 'react';
|
||||
|
||||
export interface IRenameIconProps {
|
||||
className: string;
|
||||
}
|
||||
|
||||
export const RenameIcon: React.FunctionComponent<IRenameIconProps> = ({
|
||||
className
|
||||
}: React.PropsWithChildren<IRenameIconProps>) => {
|
||||
return (
|
||||
<svg className={className} fill="currentColor" aria-hidden="true" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.5 2a.5.5 0 0 0 0 1h1v14h-1a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1h-1V3h1a.5.5 0 0 0 0-1h-3Zm-4 2h4v1h-4C3.67 5 3 5.67 3 6.5v7c0 .83.67 1.5 1.5 1.5h4v1h-4A2.5 2.5 0 0 1 2 13.5v-7A2.5 2.5 0 0 1 4.5 4Zm11 11h-4v1h4a2.5 2.5 0 0 0 2.5-2.5v-7A2.5 2.5 0 0 0 15.5 4h-4v1h4c.83 0 1.5.67 1.5 1.5v7c0 .83-.67 1.5-1.5 1.5Z" fill="currentColor"></path></svg>
|
||||
);
|
||||
};
|
||||
149
src/components/shadcn/Dropdown.tsx
Normal file
@@ -0,0 +1,149 @@
|
||||
"use client"
|
||||
|
||||
import * as React from "react"
|
||||
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
|
||||
import { cn } from "../../utils/cn"
|
||||
import { ChevronRightIcon } from "@heroicons/react/24/outline"
|
||||
|
||||
|
||||
const DropdownMenu = DropdownMenuPrimitive.Root
|
||||
|
||||
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
|
||||
|
||||
const DropdownMenuGroup = DropdownMenuPrimitive.Group
|
||||
|
||||
const DropdownMenuPortal = DropdownMenuPrimitive.Portal
|
||||
|
||||
const DropdownMenuSub = DropdownMenuPrimitive.Sub
|
||||
|
||||
const DropdownMenuSubTrigger = React.forwardRef<
|
||||
React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
|
||||
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
|
||||
inset?: boolean
|
||||
}
|
||||
>(({ className, inset, children, ...props }, ref) => (
|
||||
<DropdownMenuPrimitive.SubTrigger
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-[var(--vscode-list-hoverBackground)] data-[state=open]:bg-[var(--vscode-list-hoverBackground)]",
|
||||
inset && "pl-8",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
<ChevronRightIcon className="ml-auto h-4 w-4" />
|
||||
</DropdownMenuPrimitive.SubTrigger>
|
||||
))
|
||||
DropdownMenuSubTrigger.displayName =
|
||||
DropdownMenuPrimitive.SubTrigger.displayName
|
||||
|
||||
const DropdownMenuSubContent = React.forwardRef<
|
||||
React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
|
||||
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<DropdownMenuPrimitive.SubContent
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"z-50 min-w-[8rem] overflow-hidden rounded border border-[var(--frontmatter-border)] bg-[var(--vscode-sideBar-background)] p-1 text-[var(--vscode-editor-foreground)] shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
))
|
||||
DropdownMenuSubContent.displayName =
|
||||
DropdownMenuPrimitive.SubContent.displayName
|
||||
|
||||
const DropdownMenuContent = React.forwardRef<
|
||||
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
|
||||
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
|
||||
>(({ className, sideOffset = 4, ...props }, ref) => (
|
||||
<DropdownMenuPrimitive.Portal>
|
||||
<DropdownMenuPrimitive.Content
|
||||
ref={ref}
|
||||
sideOffset={sideOffset}
|
||||
className={cn(
|
||||
"z-50 min-w-[8rem] rounded border border-[var(--frontmatter-border)] bg-[var(--vscode-sideBar-background)] p-1 text-[var(--vscode-editor-foreground)] shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 max-h-96 overflow-auto",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
</DropdownMenuPrimitive.Portal>
|
||||
))
|
||||
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
|
||||
|
||||
const DropdownMenuItem = React.forwardRef<
|
||||
React.ElementRef<typeof DropdownMenuPrimitive.Item>,
|
||||
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
|
||||
inset?: boolean
|
||||
}
|
||||
>(({ className, inset, ...props }, ref) => (
|
||||
<DropdownMenuPrimitive.Item
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"relative flex select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-[var(--vscode-list-hoverBackground)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50 cursor-pointer disabled:opacity-50",
|
||||
inset && "pl-8",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
))
|
||||
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
|
||||
|
||||
const DropdownMenuLabel = React.forwardRef<
|
||||
React.ElementRef<typeof DropdownMenuPrimitive.Label>,
|
||||
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
|
||||
inset?: boolean
|
||||
}
|
||||
>(({ className, inset, ...props }, ref) => (
|
||||
<DropdownMenuPrimitive.Label
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"px-2 py-1.5 text-sm font-semibold",
|
||||
inset && "pl-8",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
))
|
||||
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
|
||||
|
||||
const DropdownMenuSeparator = React.forwardRef<
|
||||
React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
|
||||
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<DropdownMenuPrimitive.Separator
|
||||
ref={ref}
|
||||
className={cn("-mx-1 my-1 h-px bg-[var(--frontmatter-border)]", className)}
|
||||
{...props}
|
||||
/>
|
||||
))
|
||||
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
|
||||
|
||||
const DropdownMenuShortcut = ({
|
||||
className,
|
||||
...props
|
||||
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
||||
return (
|
||||
<span
|
||||
className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
DropdownMenuShortcut.displayName = "DropdownMenuShortcut"
|
||||
|
||||
export {
|
||||
DropdownMenu,
|
||||
DropdownMenuTrigger,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuLabel,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuShortcut,
|
||||
DropdownMenuGroup,
|
||||
DropdownMenuPortal,
|
||||
DropdownMenuSub,
|
||||
DropdownMenuSubContent,
|
||||
DropdownMenuSubTrigger,
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import { LabelField } from './LabelField';
|
||||
export type BoolFieldProps = HTMLFieldProps<
|
||||
boolean,
|
||||
HTMLDivElement,
|
||||
{ inputRef?: Ref<HTMLInputElement> }
|
||||
{ inputRef?: Ref<HTMLInputElement>, description?: string }
|
||||
>;
|
||||
|
||||
function Bool({
|
||||
@@ -37,6 +37,12 @@ function Bool({
|
||||
/>
|
||||
<span className="field__toggle__slider"></span>
|
||||
</label>
|
||||
|
||||
{
|
||||
props.description && (
|
||||
<span className='block text-xs text-[var(--vscode--settings-headerForeground)] opacity-75 mt-2 mx-2'>{props.description}</span>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ const dateFormat = (value?: Date) => value?.toISOString().slice(0, -8);
|
||||
export type DateFieldProps = HTMLFieldProps<
|
||||
Date,
|
||||
HTMLDivElement,
|
||||
{ inputRef?: Ref<HTMLInputElement>; max?: Date; min?: Date }
|
||||
{ inputRef?: Ref<HTMLInputElement>; max?: Date; min?: Date, description?: string }
|
||||
>;
|
||||
|
||||
function Date({
|
||||
@@ -50,6 +50,12 @@ function Date({
|
||||
type="datetime-local"
|
||||
value={dateFormat(value) ?? ''}
|
||||
/>
|
||||
|
||||
{
|
||||
props.description && (
|
||||
<span className='block text-xs text-[var(--vscode--settings-headerForeground)] opacity-75 mt-2 mx-2'>{props.description}</span>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PlusIcon } from '@heroicons/react/outline';
|
||||
import { PlusIcon } from '@heroicons/react/24/outline';
|
||||
import * as React from 'react';
|
||||
import { HTMLFieldProps, connectField, filterDOMProps, joinName, useField } from 'uniforms';
|
||||
import './ListAddField.css';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { TrashIcon } from '@heroicons/react/outline';
|
||||
import { TrashIcon } from '@heroicons/react/24/outline';
|
||||
import * as React from 'react';
|
||||
import { HTMLFieldProps, connectField, filterDOMProps, joinName, useField } from 'uniforms';
|
||||
import './ListDelField.css';
|
||||
@@ -29,7 +29,7 @@ function ListDel({ disabled, name, readOnly, ...props }: ListDelFieldProps) {
|
||||
|
||||
return (
|
||||
<span
|
||||
className="autoform__list_del_field"
|
||||
className="autoform__list_del_field mb-1"
|
||||
{...filterDOMProps(props)}
|
||||
onClick={onAction}
|
||||
onKeyDown={onAction}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { LabelField } from './LabelField';
|
||||
export type LongTextFieldProps = HTMLFieldProps<
|
||||
string,
|
||||
HTMLDivElement,
|
||||
{ inputRef?: Ref<HTMLTextAreaElement> }
|
||||
{ inputRef?: Ref<HTMLTextAreaElement>, description?: string }
|
||||
>;
|
||||
|
||||
function LongText({
|
||||
@@ -26,6 +26,7 @@ function LongText({
|
||||
<LabelField label={label} id={id} required={props.required} />
|
||||
|
||||
<textarea
|
||||
className={`block w-full py-2 pr-2 sm:text-sm appearance-none disabled:opacity-50 rounded bg-[var(--vscode-input-background)] text-[var(--vscode-input-foreground)] placeholder-[var(--vscode-input-placeholderForeground)] border-[var(--frontmatter-border)] focus:border-[var(--vscode-focusBorder)] focus:outline-0`}
|
||||
disabled={disabled}
|
||||
id={id}
|
||||
name={name}
|
||||
@@ -35,6 +36,12 @@ function LongText({
|
||||
ref={inputRef}
|
||||
value={value ?? ''}
|
||||
/>
|
||||
|
||||
{
|
||||
props.description && (
|
||||
<span className='block text-xs text-[var(--vscode--settings-headerForeground)] opacity-75 mt-2 mx-2'>{props.description}</span>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { LabelField } from './LabelField';
|
||||
export type NumFieldProps = HTMLFieldProps<
|
||||
number,
|
||||
HTMLDivElement,
|
||||
{ decimal?: boolean; inputRef?: Ref<HTMLInputElement> }
|
||||
{ decimal?: boolean; inputRef?: Ref<HTMLInputElement>, description?: string }
|
||||
>;
|
||||
|
||||
function Num({
|
||||
@@ -47,6 +47,12 @@ function Num({
|
||||
type="number"
|
||||
value={value ?? ''}
|
||||
/>
|
||||
|
||||
{
|
||||
props.description && (
|
||||
<span className='block text-xs text-[var(--vscode--settings-headerForeground)] opacity-75 mt-2 mx-2'>{props.description}</span>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { LabelField } from './LabelField';
|
||||
export type TextFieldProps = HTMLFieldProps<
|
||||
string,
|
||||
HTMLDivElement,
|
||||
{ inputRef?: Ref<HTMLInputElement> }
|
||||
{ inputRef?: Ref<HTMLInputElement>, description?: string }
|
||||
>;
|
||||
|
||||
function Text({
|
||||
@@ -28,6 +28,7 @@ function Text({
|
||||
<LabelField label={label} id={id} required={props.required} />
|
||||
|
||||
<input
|
||||
className='block w-full py-2 pr-2 sm:text-sm appearance-none disabled:opacity-50 rounded bg-[var(--vscode-input-background)] text-[var(--vscode-input-foreground)] placeholder-[var(--vscode-input-placeholderForeground)] border-[var(--frontmatter-border)] focus:border-[var(--vscode-focusBorder)] focus:outline-0'
|
||||
autoComplete={autoComplete}
|
||||
disabled={disabled}
|
||||
id={id}
|
||||
@@ -39,6 +40,12 @@ function Text({
|
||||
type={type}
|
||||
value={value ?? ''}
|
||||
/>
|
||||
|
||||
{
|
||||
props.description && (
|
||||
<span className='block text-xs text-[var(--vscode--settings-headerForeground)] opacity-75 mt-2 mx-2'>{props.description}</span>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { LocalizationKey } from '../../localization';
|
||||
export type UnknownFieldProps = HTMLFieldProps<
|
||||
string,
|
||||
HTMLDivElement,
|
||||
{ inputRef?: Ref<HTMLInputElement> }
|
||||
{ inputRef?: Ref<HTMLInputElement>, description?: string }
|
||||
>;
|
||||
|
||||
function UnknownField({
|
||||
@@ -30,6 +30,12 @@ function UnknownField({
|
||||
<LabelField label={label} id={id} required={props.required} />
|
||||
|
||||
<div className={`text-[var(--vscode-errorForeground)]`}>{l10n.t(LocalizationKey.fieldUnknown)}</div>
|
||||
|
||||
{
|
||||
props.description && (
|
||||
<span className='block text-xs text-[var(--vscode--settings-headerForeground)] opacity-75 mt-2 mx-2'>{props.description}</span>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
12
src/constants/DefaultFeatureFlags.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { FEATURE_FLAG } from './Features';
|
||||
|
||||
export const DEFAULT_PANEL_FEATURE_FLAGS = Object.values(FEATURE_FLAG.panel).filter(
|
||||
(v) => v !== FEATURE_FLAG.panel.globalSettings
|
||||
);
|
||||
|
||||
export const DEFAULT_DASHBOARD_FEATURE_FLAGS = [
|
||||
FEATURE_FLAG.dashboard.data.view,
|
||||
FEATURE_FLAG.dashboard.taxonomy.view,
|
||||
FEATURE_FLAG.dashboard.snippets.view,
|
||||
FEATURE_FLAG.dashboard.snippets.manage
|
||||
];
|
||||
@@ -27,6 +27,7 @@ export const COMMAND_NAME = {
|
||||
initTemplate: getCommandName('initTemplate'),
|
||||
collapseSections: getCommandName('collapseSections'),
|
||||
preview: getCommandName('preview'),
|
||||
docs: getCommandName('docs'),
|
||||
chatbot: getCommandName('chatbot'),
|
||||
dashboard: getCommandName('dashboard'),
|
||||
dashboardMedia: getCommandName('dashboard.media'),
|
||||
@@ -67,6 +68,11 @@ export const COMMAND_NAME = {
|
||||
addMissingFields: getCommandName('contenttype.addMissingFields'),
|
||||
setContentType: getCommandName('contenttype.setContentType'),
|
||||
|
||||
// i18n
|
||||
i18n: {
|
||||
create: getCommandName('i18n.create')
|
||||
},
|
||||
|
||||
// Project
|
||||
switchProject: getCommandName('project.switch'),
|
||||
|
||||
|
||||
@@ -30,5 +30,15 @@ export const ExtensionState = {
|
||||
v7_0_0: {
|
||||
dateFields: `frontMatter:Updates:v7.0.0:dateFields`
|
||||
}
|
||||
},
|
||||
|
||||
Secrets: {
|
||||
Deepl: {
|
||||
ApiKey: `frontMatter:Secrets:DeeplApiKey`
|
||||
},
|
||||
Azure: {
|
||||
TranslatorKey: `frontMatter:Secrets:AzureTranslatorKey`,
|
||||
TranslatorRegion: `frontMatter:Secrets:AzureTranslatorRegion`
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -6,7 +6,8 @@ export const FEATURE_FLAG = {
|
||||
metadata: 'panel.metadata',
|
||||
recentlyModified: 'panel.recentlyModified',
|
||||
otherActions: 'panel.otherActions',
|
||||
contentType: 'panel.contentType'
|
||||
contentType: 'panel.contentType',
|
||||
gitActions: 'panel.gitActions'
|
||||
},
|
||||
dashboard: {
|
||||
snippets: {
|
||||
|
||||
@@ -1,13 +1,36 @@
|
||||
export const GeneralCommands = {
|
||||
toWebview: {
|
||||
setMode: 'setMode',
|
||||
gitSyncingStart: 'gitSyncingStart',
|
||||
gitSyncingEnd: 'gitSyncingEnd',
|
||||
git: {
|
||||
syncingStart: 'gitSyncingStart',
|
||||
syncingEnd: 'gitSyncingEnd',
|
||||
branchName: 'gitBranchName'
|
||||
},
|
||||
setLocalization: 'setLocalization'
|
||||
},
|
||||
toVSCode: {
|
||||
openLink: 'openLink',
|
||||
gitSync: 'gitSync',
|
||||
git: {
|
||||
isRepo: 'gitIsRepo',
|
||||
sync: 'gitSync',
|
||||
fetch: 'getFetch',
|
||||
getBranch: 'getBranch',
|
||||
selectBranch: 'gitSelectBranch'
|
||||
},
|
||||
secrets: {
|
||||
get: 'getSecret',
|
||||
set: 'setSecret'
|
||||
},
|
||||
content: {
|
||||
locales: 'getContentLocales'
|
||||
},
|
||||
logging: {
|
||||
info: 'logInfo',
|
||||
warn: 'logWarn',
|
||||
error: 'logError',
|
||||
verbose: 'logVerbose'
|
||||
},
|
||||
runCommand: 'runCommand',
|
||||
getLocalization: 'getLocalization',
|
||||
openOnWebsite: 'openOnWebsite'
|
||||
}
|
||||
|
||||
3
src/constants/Git.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export const GIT_CONFIG = {
|
||||
defaultCommitMessage: 'Synced by Front Matter'
|
||||
};
|
||||
@@ -8,3 +8,18 @@ export const DOCUMENTATION_SETTINGS_LINK = 'https://frontmatter.codes/docs/setti
|
||||
|
||||
export const SENTRY_LINK =
|
||||
'https://1ac45704bbe74264a7b4674bdc2abf48@o1022172.ingest.sentry.io/5988293';
|
||||
|
||||
export const DOCS_SUBMODULES = 'https://frontmatter.codes/docs/git-integration#git-submodules';
|
||||
|
||||
export const WEBSITE_LINKS = {
|
||||
root: 'https://frontmatter.codes',
|
||||
api: {
|
||||
metrics: 'https://frontmatter.codes/api/metrics',
|
||||
ai: 'https://frontmatter.codes/api/ai'
|
||||
},
|
||||
docs: {
|
||||
dataDashboard: 'https://frontmatter.codes/docs/dashboard/datafiles-view',
|
||||
snippets: `https://frontmatter.codes/docs/snippets`,
|
||||
snippetsPlaceholders: `https://frontmatter.codes/docs/snippets#placeholders`
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
export const SentryIgnore = [
|
||||
`ResizeObserver loop limit exceeded`,
|
||||
`Cannot read properties of undefined (reading 'unobserve')`,
|
||||
`TypeError: Cannot read properties of undefined (reading 'unobserve')`
|
||||
`TypeError: Cannot read properties of undefined (reading 'unobserve')`,
|
||||
`ResizeObserver loop completed with undelivered notifications.`
|
||||
];
|
||||
|
||||
@@ -47,7 +47,10 @@ export const TelemetryEvent = {
|
||||
webviewContentsView: 'webviewContentsView',
|
||||
webviewSnippetsView: 'webviewSnippetsView',
|
||||
webviewTaxonomyDashboard: 'webviewTaxonomyDashboard',
|
||||
webviewSettings: 'webviewSettings',
|
||||
webviewUnknown: 'webviewUnknown',
|
||||
|
||||
// Git
|
||||
gitSync: 'gitSync'
|
||||
gitSync: 'gitSync',
|
||||
gitFetch: 'gitFetch'
|
||||
};
|
||||
|
||||
@@ -6,6 +6,9 @@ export const CONTEXT = {
|
||||
wysiwyg: 'frontMatter:markdown:wysiwyg',
|
||||
backer: 'frontMatter:backers:supporter',
|
||||
isValidFile: 'frontMatter:file:isValid',
|
||||
isDevelopment: 'frontMatter:isDevelopment',
|
||||
|
||||
isI18nEnabled: 'frontMatter:i18n:enabled',
|
||||
|
||||
hasViewModes: 'frontMatter:has:modes',
|
||||
|
||||
@@ -14,5 +17,5 @@ export const CONTEXT = {
|
||||
|
||||
isGitEnabled: 'frontMatter:git:enabled',
|
||||
|
||||
projectSwitchEnabled: 'frontMatter:project:switch:enabled',
|
||||
projectSwitchEnabled: 'frontMatter:project:switch:enabled'
|
||||
};
|
||||
|
||||
@@ -7,6 +7,7 @@ export * from './ExtensionState';
|
||||
export * from './Features';
|
||||
export * from './FrameworkDetectors';
|
||||
export * from './GeneralCommands';
|
||||
export * from './Git';
|
||||
export * from './Links';
|
||||
export * from './LocalStore';
|
||||
export * from './Navigation';
|
||||
|
||||
@@ -25,6 +25,7 @@ export const SETTING_TAXONOMY_CONTENT_TYPES = 'taxonomy.contentTypes';
|
||||
|
||||
export const SETTING_SLUG_PREFIX = 'taxonomy.slugPrefix';
|
||||
export const SETTING_SLUG_SUFFIX = 'taxonomy.slugSuffix';
|
||||
export const SETTING_SLUG_TEMPLATE = 'taxonomy.slugTemplate';
|
||||
export const SETTING_SLUG_UPDATE_FILE_NAME = 'taxonomy.alignFilename';
|
||||
|
||||
export const SETTING_INDENT_ARRAY = 'taxonomy.indentArrays';
|
||||
@@ -51,15 +52,18 @@ export const SETTING_PANEL_ACTIONS_DISABLED = 'panel.actions.disabled';
|
||||
|
||||
export const SETTING_PREVIEW_HOST = 'preview.host';
|
||||
export const SETTING_PREVIEW_PATHNAME = 'preview.pathName';
|
||||
export const SETTING_PREVIEW_TRAILING_SLASH = 'preview.trailingSlash';
|
||||
|
||||
export const SETTING_CUSTOM_SCRIPTS = 'custom.scripts';
|
||||
|
||||
export const SETTING_AUTO_UPDATE_DATE = 'content.autoUpdateDate';
|
||||
export const SETTING_CONTENT_PAGE_FOLDERS = 'content.pageFolders';
|
||||
export const SETTING_CONTENT_I18N = 'content.i18n';
|
||||
export const SETTING_CONTENT_STATIC_FOLDER = 'content.publicFolder';
|
||||
export const SETTING_CONTENT_FRONTMATTER_HIGHLIGHT = 'content.fmHighlight';
|
||||
export const SETTING_CONTENT_DRAFT_FIELD = 'content.draftField';
|
||||
export const SETTING_CONTENT_SORTING = 'content.sorting';
|
||||
export const SETTING_CONTENT_FILTERS = 'content.filters';
|
||||
export const SETTING_CONTENT_WYSIWYG = 'content.wysiwyg';
|
||||
export const SETTING_CONTENT_PLACEHOLDERS = 'content.placeholders';
|
||||
export const SETTING_CONTENT_SNIPPETS = 'content.snippets';
|
||||
@@ -74,6 +78,7 @@ export const SETTING_CONTENT_HIDE_FRONTMATTER = 'content.hideFm';
|
||||
export const SETTING_CONTENT_HIDE_FRONTMATTER_MESSAGE = 'content.hideFmMessage';
|
||||
|
||||
export const SETTING_MEDIA_SUPPORTED_MIMETYPES = 'media.supportedMimeTypes';
|
||||
export const SETTING_MEDIA_CONTENTTYPES = 'media.contentTypes';
|
||||
|
||||
export const SETTING_DASHBOARD_OPENONSTART = 'dashboard.openOnStart';
|
||||
export const SETTING_DASHBOARD_CONTENT_TAGS = 'dashboard.content.cardTags';
|
||||
@@ -98,6 +103,8 @@ export const SETTING_FRAMEWORK_START = 'framework.startCommand';
|
||||
export const SETTING_SITE_BASEURL = 'site.baseURL';
|
||||
|
||||
export const SETTING_GIT_ENABLED = 'git.enabled';
|
||||
export const SETTING_GIT_DISABLED_BRANCHES = 'git.disableOnBranches';
|
||||
export const SETTING_GIT_REQUIRES_COMMIT_MSG = 'git.requiresCommitMessage';
|
||||
export const SETTING_GIT_COMMIT_MSG = 'git.commitMessage';
|
||||
export const SETTING_GIT_SUBMODULE_PULL = 'git.submodule.pull';
|
||||
export const SETTING_GIT_SUBMODULE_PUSH = 'git.submodule.push';
|
||||
@@ -108,6 +115,8 @@ export const SETTING_SNIPPETS_WRAPPER = 'snippets.wrapper.enabled';
|
||||
|
||||
export const SETTING_WEBSITE_URL = 'website.host';
|
||||
|
||||
export const SETTING_LOGGING = 'logging';
|
||||
|
||||
/**
|
||||
* Sponsors only settings
|
||||
*/
|
||||
@@ -127,13 +136,3 @@ export const SETTING_CONTENT_FOLDERS = 'content.folders';
|
||||
* Use the `isPublishDate` property on the content type datetime field instead
|
||||
*/
|
||||
export const SETTING_DATE_FIELD = 'taxonomy.dateField';
|
||||
/**
|
||||
* @deprecated
|
||||
* Use the `isModifiedDate` property on the content type datetime field instead
|
||||
*/
|
||||
export const SETTING_MODIFIED_FIELD = 'taxonomy.modifiedField';
|
||||
/**
|
||||
* @deprecated
|
||||
* Use the `frontMatter.content.snippets` setting instead
|
||||
*/
|
||||
export const SETTING_DASHBOARD_MEDIA_SNIPPET = 'dashboard.mediaSnippet';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export enum DashboardCommand {
|
||||
initializing = 'initializing',
|
||||
loading = 'loading',
|
||||
pages = 'pages',
|
||||
searchPages = 'searchPages',
|
||||
|
||||
@@ -30,6 +30,7 @@ export enum DashboardMessage {
|
||||
getPinnedItems = 'getPinnedItems',
|
||||
pinItem = 'pinItem',
|
||||
unpinItem = 'unpinItem',
|
||||
rename = 'rename',
|
||||
|
||||
// Media Dashboard
|
||||
getMedia = 'getMedia',
|
||||
@@ -54,6 +55,7 @@ export enum DashboardMessage {
|
||||
insertSnippet = 'insertSnippet',
|
||||
addSnippet = 'addSnippet',
|
||||
updateSnippet = 'updateSnippet',
|
||||
updateSnippetPlaceholders = 'updateSnippetPlaceholders',
|
||||
|
||||
// Taxonomy dashboard
|
||||
getTaxonomyData = 'getTaxonomyData',
|
||||
@@ -64,14 +66,17 @@ export enum DashboardMessage {
|
||||
createTaxonomy = 'createTaxonomy',
|
||||
importTaxonomy = 'importTaxonomy',
|
||||
moveTaxonomy = 'moveTaxonomy',
|
||||
mapTaxonomy = 'mapTaxonomy',
|
||||
|
||||
// Other
|
||||
getTheme = 'getTheme',
|
||||
updateSetting = 'updateSetting',
|
||||
setState = 'setState',
|
||||
getState = 'getState',
|
||||
runCustomScript = 'runCustomScript',
|
||||
sendTelemetry = 'sendTelemetry',
|
||||
logError = 'logError',
|
||||
showNotification = 'showNotification',
|
||||
setTitle = 'setTitle',
|
||||
|
||||
// Settings
|
||||
getSettings = 'getSettings',
|
||||
|
||||
@@ -9,8 +9,8 @@ import { Contents } from './Contents/Contents';
|
||||
import { Media } from './Media/Media';
|
||||
import { DataView } from './DataView';
|
||||
import { Snippets } from './SnippetsView/Snippets';
|
||||
import { FEATURE_FLAG } from '../../constants';
|
||||
import { Messenger } from '@estruyf/vscode/dist/client';
|
||||
import { FEATURE_FLAG, GeneralCommands } from '../../constants';
|
||||
import { Messenger, messageHandler } from '@estruyf/vscode/dist/client';
|
||||
import { TaxonomyView } from './TaxonomyView';
|
||||
import { Route, Routes, useNavigate } from 'react-router-dom';
|
||||
import { routePaths } from '..';
|
||||
@@ -18,7 +18,6 @@ import { useEffect, useMemo, useState } from 'react';
|
||||
import { UnknownView } from './UnknownView';
|
||||
import { ErrorBoundary } from '@sentry/react';
|
||||
import { ErrorView } from './ErrorView';
|
||||
import { DashboardMessage } from '../DashboardMessage';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../../localization';
|
||||
import { SettingsView } from './SettingsView/SettingsView';
|
||||
@@ -30,7 +29,7 @@ export interface IAppProps {
|
||||
export const App: React.FunctionComponent<IAppProps> = ({
|
||||
showWelcome
|
||||
}: React.PropsWithChildren<IAppProps>) => {
|
||||
const { loading, pages, settings, localeReady } = useMessages();
|
||||
const { pages, settings } = useMessages();
|
||||
const view = useRecoilValue(DashboardViewSelector);
|
||||
const mode = useRecoilValue(ModeAtom);
|
||||
const [isDevMode, setIsDevMode] = useState(false);
|
||||
@@ -55,7 +54,27 @@ export const App: React.FunctionComponent<IAppProps> = ({
|
||||
return isAllowed(mode?.features || [], FEATURE_FLAG.dashboard.taxonomy.view);
|
||||
}, [mode?.features]);
|
||||
|
||||
const checkDevMode = (retry: number = 0) => {
|
||||
if (!window.fmExternal) {
|
||||
if (retry < 5) {
|
||||
setTimeout(() => checkDevMode(retry + 1), 150);
|
||||
} else {
|
||||
setIsDevMode(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (window.fmExternal && window.fmExternal.isDevelopment) {
|
||||
setIsDevMode(true);
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
messageHandler.send(GeneralCommands.toVSCode.logging.verbose, {
|
||||
message: `Loaded with view ${view}`,
|
||||
location: 'DASHBOARD'
|
||||
});
|
||||
|
||||
if (view && routePaths[view]) {
|
||||
navigate(routePaths[view]);
|
||||
return;
|
||||
@@ -65,12 +84,26 @@ export const App: React.FunctionComponent<IAppProps> = ({
|
||||
}, [view]);
|
||||
|
||||
useEffect(() => {
|
||||
if (window.fmExternal && window.fmExternal.isDevelopment) {
|
||||
setIsDevMode(true);
|
||||
if (settings && Object.keys(settings).length > 0) {
|
||||
messageHandler.send(GeneralCommands.toVSCode.logging.verbose, {
|
||||
message: `Settings loaded`,
|
||||
location: 'DASHBOARD'
|
||||
});
|
||||
}
|
||||
|
||||
if (pages) {
|
||||
messageHandler.send(GeneralCommands.toVSCode.logging.verbose, {
|
||||
message: `Pages loaded - ${pages.length} pages`,
|
||||
location: 'DASHBOARD'
|
||||
});
|
||||
}
|
||||
}, [JSON.stringify(settings), JSON.stringify(pages)]);
|
||||
|
||||
useEffect(() => {
|
||||
checkDevMode();
|
||||
}, []);
|
||||
|
||||
if (!settings || !localeReady) {
|
||||
if (!settings) {
|
||||
return <Spinner />;
|
||||
}
|
||||
|
||||
@@ -87,11 +120,14 @@ export const App: React.FunctionComponent<IAppProps> = ({
|
||||
fallback={<ErrorView />}
|
||||
onError={(error: Error, componentStack: string, eventId: string) => {
|
||||
Messenger.send(
|
||||
DashboardMessage.logError,
|
||||
`Event ID: ${eventId}
|
||||
GeneralCommands.toVSCode.logging.error,
|
||||
{
|
||||
message: `Event ID: ${eventId}
|
||||
Message: ${error.message}
|
||||
|
||||
Stack: ${componentStack}`
|
||||
Stack: ${componentStack}`,
|
||||
location: 'DASHBOARD'
|
||||
}
|
||||
);
|
||||
}}
|
||||
>
|
||||
@@ -123,7 +159,7 @@ Stack: ${componentStack}`
|
||||
<Route path={routePaths.welcome} element={<WelcomeScreen settings={settings} />} />
|
||||
<Route
|
||||
path={routePaths.contents}
|
||||
element={<Contents pages={pages} loading={loading} />}
|
||||
element={<Contents pages={pages} />}
|
||||
/>
|
||||
<Route path={routePaths.media} element={<Media />} />
|
||||
<Route path={routePaths.snippets} element={<Snippets />} />
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { PaperAirplaneIcon } from '@heroicons/react/outline';
|
||||
import { PaperAirplaneIcon } from '@heroicons/react/24/outline';
|
||||
import * as React from 'react';
|
||||
import { useCallback } from 'react';
|
||||
import useThemeColors from '../../hooks/useThemeColors';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
|
||||
@@ -13,7 +12,6 @@ export interface IChatboxProps {
|
||||
export const Chatbox: React.FunctionComponent<IChatboxProps> = ({ isLoading, onTrigger }: React.PropsWithChildren<IChatboxProps>) => {
|
||||
const [message, setMessage] = React.useState<string>("");
|
||||
const [isFocussed, setIsFocussed] = React.useState<boolean>(false);
|
||||
const { getColors } = useThemeColors();
|
||||
|
||||
const callAi = useCallback(() => {
|
||||
setTimeout(() => {
|
||||
@@ -29,11 +27,7 @@ export const Chatbox: React.FunctionComponent<IChatboxProps> = ({ isLoading, onT
|
||||
<div className='chatbox px-4'>
|
||||
<textarea
|
||||
className={`
|
||||
resize-none w-full outline-none border-0 pr-8
|
||||
${getColors(
|
||||
'focus:outline-none border-gray-300 text-vulcan-500',
|
||||
'border-transparent bg-[var(--vscode-input-background)] text-[var(--vscode-input-foreground)] placeholder-[var(--vscode-input-placeholderForeground)] focus:outline-none focus:border-transparent'
|
||||
)}`}
|
||||
resize-none w-full outline-none border-0 pr-8 border-transparent bg-[var(--vscode-input-background)] text-[var(--vscode-input-foreground)] placeholder-[var(--vscode-input-placeholderForeground)] focus:outline-none focus:border-transparent`}
|
||||
placeholder={l10n.t(LocalizationKey.dashboardChatbotChatboxPlaceholder)}
|
||||
autoFocus={true}
|
||||
value={message}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import { ThumbDownIcon, ThumbUpIcon } from '@heroicons/react/outline';
|
||||
import { ThumbDownIcon as ThumbDownSolidIcon, ThumbUpIcon as ThumbUpSolidIcon } from '@heroicons/react/solid';
|
||||
import { HandThumbDownIcon, HandThumbUpIcon } from '@heroicons/react/24/outline';
|
||||
import { HandThumbDownIcon as ThumbDownSolidIcon, HandThumbUpIcon as ThumbUpSolidIcon } from '@heroicons/react/24/solid';
|
||||
import { useCallback } from 'react';
|
||||
import { useSettingsContext } from '../../providers/SettingsProvider';
|
||||
|
||||
@@ -53,7 +53,7 @@ export const Feedback: React.FunctionComponent<IFeedbackProps> = ({
|
||||
isUpVoted ? (
|
||||
<ThumbUpSolidIcon className='h-4 w-4 text-[var(--vscode-textLink-foreground)]' />
|
||||
) : (
|
||||
<ThumbUpIcon className='h-4 w-4' />
|
||||
<HandThumbUpIcon className='h-4 w-4' />
|
||||
)
|
||||
}
|
||||
</button>
|
||||
@@ -64,7 +64,7 @@ export const Feedback: React.FunctionComponent<IFeedbackProps> = ({
|
||||
isDownVoted ? (
|
||||
<ThumbDownSolidIcon className='h-4 w-4 text-[var(--vscode-textLink-foreground)]' />
|
||||
) : (
|
||||
<ThumbDownIcon className='h-4 w-4' />
|
||||
<HandThumbDownIcon className='h-4 w-4' />
|
||||
)
|
||||
}
|
||||
</button>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import useThemeColors from '../../hooks/useThemeColors';
|
||||
|
||||
export interface IButtonProps {
|
||||
secondary?: boolean;
|
||||
@@ -15,19 +14,14 @@ export const Button: React.FunctionComponent<IButtonProps> = ({
|
||||
secondary,
|
||||
children
|
||||
}: React.PropsWithChildren<IButtonProps>) => {
|
||||
const { getColors } = useThemeColors();
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
className={`${className || ''
|
||||
} inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium focus:outline-none rounded ${getColors(
|
||||
'text-white dark:text-vulcan-500 disabled:bg-gray-500',
|
||||
'disabled:opacity-50'
|
||||
)
|
||||
} ${secondary ?
|
||||
getColors(`bg-red-300 hover:bg-red-400`, `bg-[var(--vscode-button-secondaryBackground)] text-[--vscode-button-secondaryForeground] hover:bg-[var(--vscode-button-secondaryHoverBackground)]`) :
|
||||
getColors(`bg-teal-600 hover:bg-teal-700`, `bg-[var(--frontmatter-button-background)] text-[var(--vscode-button-foreground)] hover:bg-[var(--frontmatter-button-hoverBackground)]`)
|
||||
} inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium focus:outline-none rounded disabled:opacity-50 ${secondary ?
|
||||
`bg-[var(--vscode-button-secondaryBackground)] text-[--vscode-button-secondaryForeground] hover:bg-[var(--vscode-button-secondaryHoverBackground)]` :
|
||||
`bg-[var(--frontmatter-button-background)] text-[var(--vscode-button-foreground)] hover:bg-[var(--frontmatter-button-hoverBackground)]`
|
||||
}
|
||||
`}
|
||||
onClick={onClick}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { Menu } from '@headlessui/react';
|
||||
import { ChevronDownIcon } from '@heroicons/react/outline';
|
||||
import { ChevronDownIcon } from '@heroicons/react/24/outline';
|
||||
import * as React from 'react';
|
||||
import useThemeColors from '../../hooks/useThemeColors';
|
||||
import { MenuItem, MenuItems } from '../Menu';
|
||||
import { MenuItem } from '../Menu';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from '../../../components/shadcn/Dropdown';
|
||||
|
||||
export interface IChoiceButtonProps {
|
||||
title: string;
|
||||
@@ -24,62 +23,52 @@ export const ChoiceButton: React.FunctionComponent<IChoiceButtonProps> = ({
|
||||
choices,
|
||||
title
|
||||
}: React.PropsWithChildren<IChoiceButtonProps>) => {
|
||||
const { getColors } = useThemeColors();
|
||||
|
||||
return (
|
||||
<span className="relative z-50 inline-flex shadow-sm rounded-md">
|
||||
<button
|
||||
type="button"
|
||||
className={`inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium ${choices.length > 0 ? `rounded-l` : `rounded`
|
||||
} ${getColors(
|
||||
`text-white dark:text-vulcan-500 bg-teal-600 hover:bg-teal-700 disabled:bg-gray-500`,
|
||||
`text-[var(--vscode-button-foreground)] bg-[var(--frontmatter-button-background)] hover:bg-[var(--vscode-button-hoverBackground)] disabled:opacity-50`
|
||||
)
|
||||
}`}
|
||||
} text-[var(--vscode-button-foreground)] bg-[var(--frontmatter-button-background)] hover:bg-[var(--vscode-button-hoverBackground)] disabled:opacity-50`}
|
||||
onClick={onClick}
|
||||
disabled={disabled}
|
||||
>
|
||||
{title}
|
||||
</button>
|
||||
|
||||
{choices.length > 0 && (
|
||||
<Menu as="span" className="-ml-px relative block">
|
||||
<Menu.Button
|
||||
className={`h-full inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium focus:outline-none rounded-r ${getColors(
|
||||
`text-white dark:text-vulcan-500 bg-teal-700 hover:bg-teal-800 disabled:bg-gray-500`,
|
||||
`text-[var(--vscode-button-foreground)] bg-[var(--frontmatter-button-background)] hover:bg-[var(--vscode-button-hoverBackground)] disabled:opacity-50`
|
||||
)
|
||||
}`}
|
||||
disabled={disabled}
|
||||
>
|
||||
<span className="sr-only">{l10n.t(LocalizationKey.dashboardCommonChoiceButtonOpen)}</span>
|
||||
<ChevronDownIcon className="h-5 w-5" aria-hidden="true" />
|
||||
</Menu.Button>
|
||||
|
||||
<MenuItems widthClass={`w-56`} disablePopper>
|
||||
<div className="py-1">
|
||||
{choices.map((choice, idx) => (
|
||||
<MenuItem
|
||||
key={idx}
|
||||
title={
|
||||
choice.icon ? (
|
||||
<div className="flex items-center">
|
||||
{choice.icon}
|
||||
<span>{choice.title}</span>
|
||||
</div>
|
||||
) : (
|
||||
choice.title
|
||||
)
|
||||
}
|
||||
value={null}
|
||||
onClick={choice.onClick}
|
||||
disabled={choice.disabled}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</MenuItems>
|
||||
</Menu>
|
||||
)}
|
||||
</span>
|
||||
{choices.length > 0 && (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger
|
||||
className='h-full inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium focus:outline-none rounded-r text-[var(--vscode-button-foreground)] bg-[var(--frontmatter-button-background)] hover:bg-[var(--vscode-button-hoverBackground)] disabled:opacity-50'
|
||||
disabled={disabled}>
|
||||
<span className="sr-only">{l10n.t(LocalizationKey.dashboardCommonChoiceButtonOpen)}</span>
|
||||
<ChevronDownIcon className={`h-4 w-4`} aria-hidden="true" />
|
||||
</DropdownMenuTrigger>
|
||||
|
||||
<DropdownMenuContent align='end'>
|
||||
{choices.map((choice, idx) => (
|
||||
<MenuItem
|
||||
key={idx}
|
||||
title={
|
||||
choice.icon ? (
|
||||
<div className="flex items-center">
|
||||
{choice.icon}
|
||||
<span>{choice.title}</span>
|
||||
</div>
|
||||
) : (
|
||||
choice.title
|
||||
)
|
||||
}
|
||||
value={null}
|
||||
onClick={choice.onClick}
|
||||
disabled={choice.disabled}
|
||||
/>
|
||||
))}
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
)
|
||||
}
|
||||
</span >
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { format as fnsFormat } from 'date-fns';
|
||||
import * as React from 'react';
|
||||
import { DateHelper } from '../../../helpers/DateHelper';
|
||||
import useThemeColors from '../../hooks/useThemeColors';
|
||||
|
||||
export interface IDateFieldProps {
|
||||
className?: string;
|
||||
@@ -15,7 +14,6 @@ export const DateField: React.FunctionComponent<IDateFieldProps> = ({
|
||||
format
|
||||
}: React.PropsWithChildren<IDateFieldProps>) => {
|
||||
const [dateValue, setDateValue] = React.useState<string>('');
|
||||
const { getColors } = useThemeColors();
|
||||
|
||||
React.useEffect(() => {
|
||||
try {
|
||||
@@ -38,7 +36,7 @@ export const DateField: React.FunctionComponent<IDateFieldProps> = ({
|
||||
}
|
||||
|
||||
return (
|
||||
<span className={`date__field ${className || ''} text-xs ${getColors(`text-vulcan-100 dark:text-whisper-900`, `text-[var(--vscode-editor-foreground)]`)}`}>
|
||||
<span className={`date__field ${className || ''} text-xs text-[var(--frontmatter-secondary-text)]`}>
|
||||
{dateValue}
|
||||
</span>
|
||||
);
|
||||
|
||||
37
src/dashboardWebView/components/Common/ItemSelection.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import * as React from 'react';
|
||||
import useSelectedItems from '../../hooks/useSelectedItems';
|
||||
import { VSCodeCheckbox } from '@vscode/webview-ui-toolkit/react';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
export interface IItemSelectionProps {
|
||||
filePath: string;
|
||||
show?: boolean;
|
||||
}
|
||||
|
||||
export const ItemSelection: React.FunctionComponent<IItemSelectionProps> = ({
|
||||
filePath,
|
||||
show
|
||||
}: React.PropsWithChildren<IItemSelectionProps>) => {
|
||||
const { onMultiSelect, selectedFiles } = useSelectedItems();
|
||||
|
||||
const cssNames = useMemo(() => {
|
||||
if (show) {
|
||||
return 'block';
|
||||
}
|
||||
return `${selectedFiles.includes(filePath) ? 'block' : 'hidden'} absolute top-2 left-2`;
|
||||
}, [show, selectedFiles]);
|
||||
|
||||
return (
|
||||
<div className={`${cssNames} group-hover:block`}>
|
||||
<VSCodeCheckbox
|
||||
style={{
|
||||
boxShadow: show ? "" : "0 0 3px var(--frontmatter-border-preserve)"
|
||||
}}
|
||||
onClick={(e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
|
||||
e.stopPropagation();
|
||||
onMultiSelect(filePath);
|
||||
}}
|
||||
checked={selectedFiles.includes(filePath)} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
18
src/dashboardWebView/components/Common/Link.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import * as React from 'react';
|
||||
|
||||
export interface ILinkProps {
|
||||
title: string;
|
||||
href: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const Link: React.FunctionComponent<ILinkProps> = ({ children, title, href, className }: React.PropsWithChildren<ILinkProps>) => {
|
||||
return (
|
||||
<a
|
||||
className={`text-[var(--frontmatter-secondary-text)] hover:text-[var(--frontmatter-link-hover)] ${className || ""}`}
|
||||
title={title}
|
||||
href={href}>
|
||||
{children}
|
||||
</a>
|
||||
);
|
||||
};
|
||||
@@ -1,5 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import useThemeColors from '../../hooks/useThemeColors';
|
||||
|
||||
export interface ILinkButtonProps {
|
||||
title: string;
|
||||
@@ -7,17 +6,10 @@ export interface ILinkButtonProps {
|
||||
}
|
||||
|
||||
export const LinkButton: React.FunctionComponent<ILinkButtonProps> = ({ children, title, onClick }: React.PropsWithChildren<ILinkButtonProps>) => {
|
||||
const { getColors } = useThemeColors();
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
className={
|
||||
getColors(
|
||||
`text-gray-500 hover:text-vulcan-600 dark:text-gray-400 dark:hover:text-whisper-600`,
|
||||
`text-[var(--frontmatter-secondary-text)] hover:text-[var(--frontmatter-link-hover)]`
|
||||
)
|
||||
}
|
||||
className={`text-[var(--frontmatter-secondary-text)] hover:text-[var(--frontmatter-link-hover)]`}
|
||||
title={title}
|
||||
onClick={onClick}>
|
||||
{children}
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
import * as React from 'react';
|
||||
import { LoadingType } from '../../../models';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
|
||||
export interface ISpinnerProps { }
|
||||
export interface ISpinnerProps {
|
||||
type?: LoadingType;
|
||||
}
|
||||
|
||||
export const Spinner: React.FunctionComponent<ISpinnerProps> = (
|
||||
_: React.PropsWithChildren<ISpinnerProps>
|
||||
{ type }: React.PropsWithChildren<ISpinnerProps>
|
||||
) => {
|
||||
return (
|
||||
<div className={`z-50 fixed top-0 left-0 right-0 bottom-0 w-full h-full bg-[var(--vscode-editor-background)] opacity-75`}>
|
||||
@@ -12,6 +17,15 @@ export const Spinner: React.FunctionComponent<ISpinnerProps> = (
|
||||
>
|
||||
<div className={`h-full absolute rounded-sm bg-[var(--vscode-activityBarBadge-background)] animate-[vscode-loader_4s_ease-in-out_infinite]`} />
|
||||
</div>
|
||||
|
||||
{
|
||||
type === 'initPages' && (
|
||||
<div className='spinner-msg h-full text-2xl flex justify-center items-center text-[var(--frontmatter-text)]'>
|
||||
<span>{l10n.t(LocalizationKey.loadingInitPages)}</span>
|
||||
<span className='dots'></span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
91
src/dashboardWebView/components/Common/TextField.tsx
Normal file
@@ -0,0 +1,91 @@
|
||||
import { XCircleIcon } from '@heroicons/react/24/solid';
|
||||
import * as React from 'react';
|
||||
|
||||
export interface ITextFieldProps {
|
||||
name: string;
|
||||
value?: string;
|
||||
placeholder?: string;
|
||||
description?: string;
|
||||
icon?: JSX.Element;
|
||||
disabled?: boolean;
|
||||
autoFocus?: boolean;
|
||||
multiline?: boolean;
|
||||
rows?: number;
|
||||
onChange?: (value: string) => void;
|
||||
onReset?: () => void;
|
||||
}
|
||||
|
||||
export const TextField: React.FunctionComponent<ITextFieldProps> = ({
|
||||
name,
|
||||
value,
|
||||
placeholder,
|
||||
description,
|
||||
icon,
|
||||
autoFocus,
|
||||
multiline,
|
||||
rows,
|
||||
disabled,
|
||||
onChange,
|
||||
onReset
|
||||
}: React.PropsWithChildren<ITextFieldProps>) => {
|
||||
return (
|
||||
<>
|
||||
|
||||
<div className="relative flex justify-center">
|
||||
{
|
||||
icon && (
|
||||
<div className="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
||||
{icon}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
{
|
||||
multiline ? (
|
||||
<textarea
|
||||
rows={rows || 3}
|
||||
name={name}
|
||||
className={`block w-full py-2 ${icon ? "pl-10" : "pl-2"} pr-2 sm:text-sm appearance-none disabled:opacity-50 rounded bg-[var(--vscode-input-background)] text-[var(--vscode-input-foreground)] placeholder-[var(--vscode-input-placeholderForeground)] border-[var(--frontmatter-border)] focus:border-[var(--vscode-focusBorder)] focus:outline-0`}
|
||||
style={{
|
||||
boxShadow: "none"
|
||||
}}
|
||||
placeholder={placeholder || ""}
|
||||
value={value}
|
||||
autoFocus={!!autoFocus}
|
||||
onChange={(e) => onChange && onChange(e.target.value)}
|
||||
disabled={!!disabled}
|
||||
/>
|
||||
) : (
|
||||
<input
|
||||
type="text"
|
||||
name={name}
|
||||
className={`block w-full py-2 ${icon ? "pl-10" : "pl-2"} pr-2 sm:text-sm appearance-none disabled:opacity-50 rounded bg-[var(--vscode-input-background)] text-[var(--vscode-input-foreground)] placeholder-[var(--vscode-input-placeholderForeground)] border-[var(--frontmatter-border)] focus:border-[var(--vscode-focusBorder)] focus:outline-0`}
|
||||
style={{
|
||||
boxShadow: "none"
|
||||
}}
|
||||
placeholder={placeholder || ""}
|
||||
value={value}
|
||||
autoFocus={!!autoFocus}
|
||||
onChange={(e) => onChange && onChange(e.target.value)}
|
||||
disabled={!!disabled}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
{(value && onReset) && (
|
||||
<button onClick={onReset} className="absolute inset-y-0 right-0 pr-3 flex items-center text-[var(--vscode-input-foreground)] hover:text-[var(--vscode-textLink-activeForeground)]">
|
||||
<XCircleIcon className={`h-5 w-5`} aria-hidden="true" />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{
|
||||
description && (
|
||||
<p className="text-xs text-[var(--vscode--settings-headerForeground)] opacity-75 mt-2 mx-2">
|
||||
{description}
|
||||
</p>
|
||||
)
|
||||
}
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -32,7 +32,6 @@ export const AstroContentTypes: React.FunctionComponent<IAstroContentTypesProps>
|
||||
if (collections.length > 0 && settings?.contentTypes?.length > 0) {
|
||||
// Find created content types from the collections
|
||||
const astroCollection = collections.find(c => settings.contentTypes.find((ct) => ct.name === c.name));
|
||||
console.log(`astroCollection`, astroCollection)
|
||||
if (astroCollection) {
|
||||
setStatus(Status.Completed);
|
||||
} else {
|
||||
|
||||
@@ -1,236 +1,170 @@
|
||||
import { Messenger, messageHandler } from '@estruyf/vscode/dist/client';
|
||||
import { Menu } from '@headlessui/react';
|
||||
import { EyeIcon, GlobeIcon, TerminalIcon, TrashIcon } from '@heroicons/react/outline';
|
||||
import { messageHandler } from '@estruyf/vscode/dist/client';
|
||||
import { EyeIcon, GlobeEuropeAfricaIcon, TrashIcon, LanguageIcon, EllipsisHorizontalIcon } from '@heroicons/react/24/outline';
|
||||
import * as React from 'react';
|
||||
import { CustomScript, ScriptType } from '../../../models';
|
||||
import { CustomScript, I18nConfig } from '../../../models';
|
||||
import { DashboardMessage } from '../../DashboardMessage';
|
||||
import { MenuItem, MenuItems, ActionMenuButton, QuickAction } from '../Menu';
|
||||
import { Alert } from '../Modals/Alert';
|
||||
import { usePopper } from 'react-popper';
|
||||
import { useState } from 'react';
|
||||
import useThemeColors from '../../hooks/useThemeColors';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
import { useRecoilState, useRecoilValue } from 'recoil';
|
||||
import { SettingsSelector } from '../../state';
|
||||
import { GeneralCommands } from '../../../constants';
|
||||
import { SelectedItemActionAtom, SettingsSelector } from '../../state';
|
||||
import { COMMAND_NAME, GeneralCommands } from '../../../constants';
|
||||
import { PinIcon } from '../Icons/PinIcon';
|
||||
import { PinnedItemsAtom } from '../../state/atom/PinnedItems';
|
||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '../../../components/shadcn/Dropdown';
|
||||
import { RenameIcon } from '../../../components/icons/RenameIcon';
|
||||
import { openOnWebsite } from '../../utils';
|
||||
import { CustomActions } from './CustomActions';
|
||||
import { TranslationMenu } from './TranslationMenu';
|
||||
|
||||
export interface IContentActionsProps {
|
||||
title: string;
|
||||
path: string;
|
||||
relPath: string;
|
||||
contentType: string;
|
||||
scripts: CustomScript[] | undefined;
|
||||
listView?: boolean;
|
||||
locale?: I18nConfig;
|
||||
isDefaultLocale?: boolean;
|
||||
translations?: {
|
||||
[locale: string]: {
|
||||
locale: I18nConfig;
|
||||
path: string;
|
||||
};
|
||||
};
|
||||
onOpen: () => void;
|
||||
}
|
||||
|
||||
export const ContentActions: React.FunctionComponent<IContentActionsProps> = ({
|
||||
title,
|
||||
path,
|
||||
relPath,
|
||||
contentType,
|
||||
scripts,
|
||||
onOpen,
|
||||
listView
|
||||
listView,
|
||||
isDefaultLocale,
|
||||
translations,
|
||||
locale
|
||||
}: React.PropsWithChildren<IContentActionsProps>) => {
|
||||
const [, setSelectedItemAction] = useRecoilState(SelectedItemActionAtom);
|
||||
const [pinnedItems, setPinnedItems] = useRecoilState(PinnedItemsAtom);
|
||||
const [showDeletionAlert, setShowDeletionAlert] = React.useState(false);
|
||||
const { getColors } = useThemeColors();
|
||||
const settings = useRecoilValue(SettingsSelector);
|
||||
|
||||
const [referenceElement, setReferenceElement] = useState<any>(null);
|
||||
const [popperElement, setPopperElement] = useState<any>(null);
|
||||
const { styles, attributes, forceUpdate } = usePopper(referenceElement, popperElement, {
|
||||
placement: listView ? 'right-start' : 'bottom-end',
|
||||
strategy: 'fixed'
|
||||
});
|
||||
|
||||
const onView = (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||
const onView = (e: React.MouseEvent<HTMLButtonElement | HTMLDivElement, MouseEvent>) => {
|
||||
e.stopPropagation();
|
||||
onOpen();
|
||||
};
|
||||
|
||||
const onDelete = (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||
const onDelete = React.useCallback((e: React.MouseEvent<HTMLButtonElement | HTMLDivElement, MouseEvent>) => {
|
||||
e.stopPropagation();
|
||||
setShowDeletionAlert(true);
|
||||
};
|
||||
setSelectedItemAction({ path, action: 'delete' });
|
||||
}, [path]);
|
||||
|
||||
const onDeleteConfirm = () => {
|
||||
if (path) {
|
||||
Messenger.send(DashboardMessage.deleteFile, path);
|
||||
}
|
||||
setShowDeletionAlert(false);
|
||||
};
|
||||
|
||||
const openOnWebsite = React.useCallback((e: React.MouseEvent<HTMLButtonElement>) => {
|
||||
const onRename = React.useCallback((e: React.MouseEvent<HTMLButtonElement | HTMLDivElement, MouseEvent>) => {
|
||||
e.stopPropagation();
|
||||
if (settings?.websiteUrl && path) {
|
||||
Messenger.send(GeneralCommands.toVSCode.openOnWebsite, {
|
||||
websiteUrl: settings.websiteUrl,
|
||||
filePath: path
|
||||
});
|
||||
}
|
||||
messageHandler.send(DashboardMessage.rename, path);
|
||||
}, [path])
|
||||
|
||||
const onOpenWebsite = React.useCallback((e: React.MouseEvent<HTMLButtonElement | HTMLDivElement, MouseEvent>) => {
|
||||
e.stopPropagation();
|
||||
openOnWebsite(settings?.websiteUrl, path);
|
||||
}, [settings?.websiteUrl, path]);
|
||||
|
||||
const pinItem = React.useCallback((e: React.MouseEvent<HTMLButtonElement>) => {
|
||||
const pinItem = React.useCallback((e: React.MouseEvent<HTMLButtonElement | HTMLDivElement, MouseEvent>) => {
|
||||
e.stopPropagation();
|
||||
messageHandler.request<string[]>(DashboardMessage.pinItem, path).then((result) => {
|
||||
setPinnedItems(result || []);
|
||||
})
|
||||
}, [path]);
|
||||
|
||||
const unpinItem = React.useCallback((e: React.MouseEvent<HTMLButtonElement>) => {
|
||||
const unpinItem = React.useCallback((e: React.MouseEvent<HTMLButtonElement | HTMLDivElement, MouseEvent>) => {
|
||||
e.stopPropagation();
|
||||
messageHandler.request<string[]>(DashboardMessage.unpinItem, path).then((result) => {
|
||||
setPinnedItems(result || []);
|
||||
})
|
||||
}, [path]);
|
||||
|
||||
const runCustomScript = React.useCallback(
|
||||
(e: React.MouseEvent<HTMLButtonElement>, script: CustomScript) => {
|
||||
e.stopPropagation();
|
||||
Messenger.send(DashboardMessage.runCustomScript, { script, path });
|
||||
},
|
||||
[path]
|
||||
);
|
||||
const runCommand = React.useCallback((commandId: string) => {
|
||||
messageHandler.send(GeneralCommands.toVSCode.runCommand, {
|
||||
command: commandId,
|
||||
args: path
|
||||
})
|
||||
}, [path]);
|
||||
|
||||
const isPinned = React.useMemo(() => {
|
||||
return pinnedItems.includes(relPath);
|
||||
}, [pinnedItems, relPath]);
|
||||
|
||||
const customScriptActions = React.useMemo(() => {
|
||||
return (scripts || [])
|
||||
.filter(
|
||||
(script) =>
|
||||
(script.type === undefined || script.type === ScriptType.Content) &&
|
||||
!script.bulk &&
|
||||
!script.hidden
|
||||
)
|
||||
.map((script) => (
|
||||
<MenuItem
|
||||
key={script.title}
|
||||
title={
|
||||
<div className="flex items-center">
|
||||
<TerminalIcon className="mr-2 h-5 w-5 flex-shrink-0" aria-hidden={true} />{' '}
|
||||
<span>{script.title}</span>
|
||||
</div>
|
||||
}
|
||||
onClick={(value, e) => runCustomScript(e, script)}
|
||||
/>
|
||||
));
|
||||
}, [scripts]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className={`${listView ? '' : 'group/card absolute top-6 right-0'
|
||||
className={`${listView ? '' : 'group/card absolute top-6 right-2'
|
||||
} flex flex-col space-y-4`}
|
||||
>
|
||||
<div
|
||||
className={`flex items-center border border-transparent rounded-full ${listView ? '' : 'p-2 -mt-4'
|
||||
} ${getColors(
|
||||
'group-hover/card:bg-gray-200 dark:group-hover/card:bg-vulcan-200 group-hover/card:border-gray-100 dark:group-hover/card:border-vulcan-50',
|
||||
'group-hover/card:bg-[var(--vscode-sideBar-background)] group-hover/card:border-[var(--frontmatter-border)]'
|
||||
)
|
||||
}`}
|
||||
className={`flex items-center border border-transparent rounded-full ${listView ? '' : 'p-1 -mt-3'
|
||||
} group-hover/card:bg-[var(--vscode-sideBar-background)] group-hover/card:border-[var(--frontmatter-border)]`}
|
||||
>
|
||||
<Menu as="div" className={`relative flex text-left`}>
|
||||
{!listView && (
|
||||
<div className="hidden group-hover/card:flex">
|
||||
<QuickAction title={l10n.t(LocalizationKey.dashboardContentsContentActionsMenuItemView)} onClick={onView}>
|
||||
<EyeIcon className={`w-4 h-4`} aria-hidden="true" />
|
||||
</QuickAction>
|
||||
<div className={`relative flex text-left`}>
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger
|
||||
className='text-[var(--vscode-tab-inactiveForeground)] hover:text-[var(--vscode-tab-activeForeground)] data-[state=open]:text-[var(--vscode-tab-activeForeground)] focus:outline-none'>
|
||||
<span className="sr-only">{l10n.t(LocalizationKey.dashboardContentsContentActionsActionMenuButtonTitle)}</span>
|
||||
<EllipsisHorizontalIcon className="w-4 h-4" aria-hidden="true" />
|
||||
</DropdownMenuTrigger>
|
||||
|
||||
<DropdownMenuContent align="end">
|
||||
<DropdownMenuItem onClick={(e) => isPinned ? unpinItem(e) : pinItem(e)}>
|
||||
<PinIcon className={`mr-2 h-4 w-4 ${isPinned ? "" : "-rotate-90"}`} aria-hidden={true} />
|
||||
<span>{isPinned ? l10n.t(LocalizationKey.commonUnpin) : l10n.t(LocalizationKey.commonPin)}</span>
|
||||
</DropdownMenuItem>
|
||||
|
||||
<DropdownMenuItem onClick={onView}>
|
||||
<EyeIcon className={`mr-2 h-4 w-4`} aria-hidden={true} />
|
||||
<span>{l10n.t(LocalizationKey.dashboardContentsContentActionsMenuItemView)}</span>
|
||||
</DropdownMenuItem>
|
||||
|
||||
<DropdownMenuItem onClick={onRename}>
|
||||
<RenameIcon className={`mr-2 h-4 w-4`} aria-hidden={true} />
|
||||
<span>{l10n.t(LocalizationKey.commonRename)}</span>
|
||||
</DropdownMenuItem>
|
||||
|
||||
{
|
||||
settings?.websiteUrl && (
|
||||
<QuickAction title={l10n.t(LocalizationKey.commonOpenOnWebsite)} onClick={openOnWebsite}>
|
||||
<GlobeIcon className={`w-4 h-4`} aria-hidden="true" />
|
||||
</QuickAction>
|
||||
<DropdownMenuItem onClick={onOpenWebsite}>
|
||||
<GlobeEuropeAfricaIcon className={`mr-2 h-4 w-4`} aria-hidden={true} />
|
||||
<span>{l10n.t(LocalizationKey.commonOpenOnWebsite)}</span>
|
||||
</DropdownMenuItem>
|
||||
)
|
||||
}
|
||||
|
||||
<QuickAction title={l10n.t(LocalizationKey.commonDelete)} onClick={onDelete}>
|
||||
<TrashIcon className={`w-4 h-4`} aria-hidden="true" />
|
||||
</QuickAction>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div ref={setReferenceElement} className={`flex`}>
|
||||
<ActionMenuButton title={l10n.t(LocalizationKey.dashboardContentsContentActionsActionMenuButtonTitle)} />
|
||||
</div>
|
||||
|
||||
<div
|
||||
className="menu_items__wrapper z-20"
|
||||
ref={setPopperElement}
|
||||
style={styles.popper}
|
||||
{...attributes.popper}
|
||||
>
|
||||
<MenuItems
|
||||
updatePopper={forceUpdate || undefined}
|
||||
widthClass="w-44"
|
||||
marginTopClass={listView ? '' : ''}
|
||||
>
|
||||
<MenuItem
|
||||
title={
|
||||
<div className="flex items-center">
|
||||
<PinIcon className={`mr-2 h-5 w-5 flex-shrink-0 ${isPinned ? "" : "-rotate-90"}`} aria-hidden={true} />{' '}
|
||||
<span>{isPinned ? l10n.t(LocalizationKey.commonUnpin) : l10n.t(LocalizationKey.commonPin)}</span>
|
||||
</div>
|
||||
}
|
||||
onClick={(_, e) => isPinned ? unpinItem(e) : pinItem(e)}
|
||||
/>
|
||||
<MenuItem
|
||||
title={
|
||||
<div className="flex items-center">
|
||||
<EyeIcon className="mr-2 h-5 w-5 flex-shrink-0" aria-hidden={true} />{' '}
|
||||
<span>{l10n.t(LocalizationKey.dashboardContentsContentActionsMenuItemView)}</span>
|
||||
</div>
|
||||
}
|
||||
onClick={(_, e) => onView(e)}
|
||||
/>
|
||||
|
||||
{
|
||||
settings?.websiteUrl && (
|
||||
<MenuItem
|
||||
title={
|
||||
<div className="flex items-center">
|
||||
<GlobeIcon className="mr-2 h-5 w-5 flex-shrink-0" aria-hidden={true} />{' '}
|
||||
<span>{l10n.t(LocalizationKey.commonOpenOnWebsite)}</span>
|
||||
</div>
|
||||
}
|
||||
onClick={(_, e) => openOnWebsite(e)}
|
||||
/>
|
||||
locale && (
|
||||
<DropdownMenuItem onClick={() => runCommand(COMMAND_NAME.i18n.create)}>
|
||||
<LanguageIcon className={`mr-2 h-4 w-4`} aria-hidden={true} />
|
||||
<span>{l10n.t(LocalizationKey.dashboardContentsContentActionsTranslationsCreate)}</span>
|
||||
</DropdownMenuItem>
|
||||
)
|
||||
}
|
||||
|
||||
{customScriptActions}
|
||||
<TranslationMenu
|
||||
isDefaultLocale={isDefaultLocale}
|
||||
locale={locale}
|
||||
translations={translations} />
|
||||
|
||||
<MenuItem
|
||||
title={
|
||||
<div className="flex items-center">
|
||||
<TrashIcon className="mr-2 h-5 w-5 flex-shrink-0" aria-hidden={true} />{' '}
|
||||
<span>{l10n.t(LocalizationKey.commonDelete)}</span>
|
||||
</div>
|
||||
}
|
||||
onClick={(_, e) => onDelete(e)}
|
||||
/>
|
||||
</MenuItems>
|
||||
</div>
|
||||
</Menu>
|
||||
<CustomActions
|
||||
filePath={path}
|
||||
contentType={contentType}
|
||||
scripts={scripts} />
|
||||
|
||||
<DropdownMenuItem onClick={onDelete} className={`focus:bg-[var(--vscode-statusBarItem-errorBackground)] focus:text-[var(--vscode-statusBarItem-errorForeground)]`}>
|
||||
<TrashIcon className={`mr-2 h-4 w-4`} aria-hidden={true} />
|
||||
<span>{l10n.t(LocalizationKey.commonDelete)}</span>
|
||||
</DropdownMenuItem>
|
||||
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{showDeletionAlert && (
|
||||
<Alert
|
||||
title={l10n.t(LocalizationKey.dashboardContentsContentActionsAlertTitle, title)}
|
||||
description={l10n.t(LocalizationKey.dashboardContentsContentActionsAlertDescription, title)}
|
||||
okBtnText={l10n.t(LocalizationKey.commonDelete)}
|
||||
cancelBtnText={l10n.t(LocalizationKey.commonCancel)}
|
||||
dismiss={() => setShowDeletionAlert(false)}
|
||||
trigger={onDeleteConfirm}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,50 +1,105 @@
|
||||
import * as React from 'react';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { useRecoilState, useRecoilValue } from 'recoil';
|
||||
import { Page } from '../../models';
|
||||
import { SettingsSelector } from '../../state';
|
||||
import { LoadingAtom, SelectedItemActionAtom, SettingsSelector } from '../../state';
|
||||
import { Overview } from './Overview';
|
||||
import { Spinner } from '../Common/Spinner';
|
||||
import { SponsorMsg } from '../Layout/SponsorMsg';
|
||||
import usePages from '../../hooks/usePages';
|
||||
import { useEffect } from 'react';
|
||||
import { Messenger } from '@estruyf/vscode/dist/client';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { Messenger, messageHandler } from '@estruyf/vscode/dist/client';
|
||||
import { DashboardMessage } from '../../DashboardMessage';
|
||||
import { TelemetryEvent } from '../../../constants';
|
||||
import { GeneralCommands, TelemetryEvent } from '../../../constants';
|
||||
import { PageLayout } from '../Layout/PageLayout';
|
||||
import { FilesProvider } from '../../providers/FilesProvider';
|
||||
import { Alert } from '../Modals/Alert';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
import { deletePage } from '../../utils';
|
||||
|
||||
export interface IContentsProps {
|
||||
pages: Page[];
|
||||
loading: boolean;
|
||||
}
|
||||
|
||||
export const Contents: React.FunctionComponent<IContentsProps> = ({
|
||||
pages,
|
||||
loading
|
||||
pages
|
||||
}: React.PropsWithChildren<IContentsProps>) => {
|
||||
const loading = useRecoilValue(LoadingAtom);
|
||||
const settings = useRecoilValue(SettingsSelector);
|
||||
const { pageItems } = usePages(pages);
|
||||
const [showDeletionAlert, setShowDeletionAlert] = React.useState(false);
|
||||
const [page, setPage] = useState<Page | undefined>(undefined);
|
||||
const [selectedItemAction, setSelectedItemAction] = useRecoilState(SelectedItemActionAtom);
|
||||
|
||||
const pageFolders = [...new Set(pageItems.map((page) => page.fmFolder))];
|
||||
|
||||
const onDismiss = useCallback(() => {
|
||||
setShowDeletionAlert(false);
|
||||
setSelectedItemAction(undefined);
|
||||
}, []);
|
||||
|
||||
const onDeleteConfirm = useCallback(() => {
|
||||
if (page) {
|
||||
deletePage(page.fmFilePath);
|
||||
}
|
||||
setShowDeletionAlert(false);
|
||||
setSelectedItemAction(undefined);
|
||||
}, [page]);
|
||||
|
||||
useEffect(() => {
|
||||
if (selectedItemAction && selectedItemAction.path && selectedItemAction.action === 'delete') {
|
||||
const page = pageItems.find((p) => p.fmFilePath === selectedItemAction.path);
|
||||
|
||||
if (page) {
|
||||
setPage(page);
|
||||
setShowDeletionAlert(true);
|
||||
}
|
||||
|
||||
setSelectedItemAction(undefined);
|
||||
}
|
||||
}, [pageItems, selectedItemAction]);
|
||||
|
||||
useEffect(() => {
|
||||
messageHandler.send(GeneralCommands.toVSCode.logging.info, {
|
||||
message: `Contents view loaded with ${pageItems.length} pages`,
|
||||
location: 'DASHBOARD'
|
||||
});
|
||||
}, [JSON.stringify(pageItems)]);
|
||||
|
||||
useEffect(() => {
|
||||
Messenger.send(DashboardMessage.sendTelemetry, {
|
||||
event: TelemetryEvent.webviewContentsView
|
||||
});
|
||||
|
||||
Messenger.send(DashboardMessage.setTitle, l10n.t(LocalizationKey.dashboardHeaderTabsContents));
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<PageLayout folders={pageFolders} totalPages={pageItems.length}>
|
||||
<div className="w-full flex-grow max-w-full mx-auto pb-6 px-4">
|
||||
{loading ? <Spinner /> : <Overview pages={pageItems} settings={settings} />}
|
||||
</div>
|
||||
<FilesProvider files={pageItems}>
|
||||
<PageLayout folders={pageFolders} totalPages={pageItems.length}>
|
||||
<div className="w-full flex-grow max-w-full mx-auto pb-6">
|
||||
{loading ? <Spinner type={loading} /> : <Overview pages={pageItems} settings={settings} />}
|
||||
</div>
|
||||
|
||||
<SponsorMsg
|
||||
beta={settings?.beta}
|
||||
version={settings?.versionInfo}
|
||||
isBacker={settings?.isBacker}
|
||||
/>
|
||||
<SponsorMsg
|
||||
beta={settings?.beta}
|
||||
version={settings?.versionInfo}
|
||||
isBacker={settings?.isBacker}
|
||||
/>
|
||||
|
||||
<img className='hidden' src="https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Ffrontmatter.codes%2Fmetrics%2Fdashboards&slug=content" alt="Content metrics" />
|
||||
</PageLayout>
|
||||
<img className='hidden' src="https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Ffrontmatter.codes%2Fmetrics%2Fdashboards&slug=content" alt="Content metrics" />
|
||||
|
||||
{showDeletionAlert && page && (
|
||||
<Alert
|
||||
title={l10n.t(LocalizationKey.dashboardContentsContentActionsAlertTitle, page.title)}
|
||||
description={l10n.t(LocalizationKey.dashboardContentsContentActionsAlertDescription, page.title)}
|
||||
okBtnText={l10n.t(LocalizationKey.commonDelete)}
|
||||
cancelBtnText={l10n.t(LocalizationKey.commonCancel)}
|
||||
dismiss={onDismiss}
|
||||
trigger={onDeleteConfirm}
|
||||
/>
|
||||
)}
|
||||
</PageLayout>
|
||||
</FilesProvider>
|
||||
);
|
||||
};
|
||||
|
||||
89
src/dashboardWebView/components/Contents/CustomActions.tsx
Normal file
@@ -0,0 +1,89 @@
|
||||
import * as React from 'react';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '../../../components/shadcn/Dropdown';
|
||||
import { CommandLineIcon } from '@heroicons/react/24/outline';
|
||||
import { CommandLineIcon as CommandLineIconSolid } from '@heroicons/react/24/solid';
|
||||
import { runCustomScript } from '../../utils';
|
||||
import { CustomScript, ScriptType } from '../../../models';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
|
||||
export interface ICustomActionsProps {
|
||||
filePath: string;
|
||||
contentType: string;
|
||||
scripts: CustomScript[] | undefined;
|
||||
showTrigger?: boolean;
|
||||
}
|
||||
|
||||
export const CustomActions: React.FunctionComponent<ICustomActionsProps> = ({
|
||||
filePath,
|
||||
contentType,
|
||||
scripts,
|
||||
showTrigger = false,
|
||||
}: React.PropsWithChildren<ICustomActionsProps>) => {
|
||||
|
||||
const onRunCustomScript = React.useCallback(
|
||||
(e: React.MouseEvent<HTMLButtonElement | HTMLDivElement, MouseEvent>, script: CustomScript) => {
|
||||
e.stopPropagation();
|
||||
runCustomScript(script, filePath);
|
||||
},
|
||||
[filePath]
|
||||
);
|
||||
|
||||
const customScripts = React.useMemo(() => {
|
||||
return (scripts || []).filter((script: CustomScript) => {
|
||||
if (script.contentTypes && script.contentTypes.length > 0) {
|
||||
return script.contentTypes.includes(contentType);
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
}, [scripts, contentType]);
|
||||
|
||||
const customActions = React.useMemo(() => {
|
||||
if (!customScripts || customScripts.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
(customScripts || [])
|
||||
.filter(
|
||||
(script) =>
|
||||
(script.type === undefined || script.type === ScriptType.Content) &&
|
||||
!script.bulk &&
|
||||
!script.hidden
|
||||
)
|
||||
.map((script) => (
|
||||
<DropdownMenuItem
|
||||
key={script.id || script.title}
|
||||
title={script.title}
|
||||
onClick={(e) => onRunCustomScript(e, script)}>
|
||||
<CommandLineIcon className={`mr-2 h-4 w-4`} aria-hidden={true} />
|
||||
<span>{script.title}</span>
|
||||
</DropdownMenuItem>
|
||||
))
|
||||
);
|
||||
}, [customScripts, onRunCustomScript]);
|
||||
|
||||
if (!customActions || customActions.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (showTrigger) {
|
||||
return (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger
|
||||
title={l10n.t(LocalizationKey.commonOpenCustomActions)}
|
||||
className='px-2 text-[var(--frontmatter-secondary-text)] hover:text-[var(--frontmatter-button-hoverBackground)] focus-visible:outline-none'>
|
||||
<span className="sr-only">{l10n.t(LocalizationKey.commonOpenCustomActions)}</span>
|
||||
<CommandLineIconSolid className="w-4 h-4" aria-hidden="true" />
|
||||
</DropdownMenuTrigger>
|
||||
|
||||
<DropdownMenuContent>
|
||||
{customActions}
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
);
|
||||
}
|
||||
|
||||
return <>{customActions}</>;
|
||||
};
|
||||
66
src/dashboardWebView/components/Contents/FooterActions.tsx
Normal file
@@ -0,0 +1,66 @@
|
||||
import * as React from 'react';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { QuickAction } from '../Menu';
|
||||
import { EyeIcon, GlobeEuropeAfricaIcon, TrashIcon } from '@heroicons/react/24/solid';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
import { openFile, openOnWebsite } from '../../utils';
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { SelectedItemActionAtom } from '../../state';
|
||||
import { CustomScript } from '../../../models';
|
||||
import { CustomActions } from './CustomActions';
|
||||
|
||||
export interface IFooterActionsProps {
|
||||
filePath: string;
|
||||
contentType: string;
|
||||
websiteUrl?: string;
|
||||
scripts?: CustomScript[];
|
||||
}
|
||||
|
||||
export const FooterActions: React.FunctionComponent<IFooterActionsProps> = ({
|
||||
filePath,
|
||||
contentType,
|
||||
websiteUrl,
|
||||
scripts
|
||||
}: React.PropsWithChildren<IFooterActionsProps>) => {
|
||||
const [, setSelectedItemAction] = useRecoilState(SelectedItemActionAtom);
|
||||
|
||||
return (
|
||||
<div className={`py-2 w-full flex items-center justify-evenly border-t border-t-[var(--frontmatter-border)] bg-[var(--frontmatter-sideBar-background)] group-hover:bg-[var(--vscode-list-hoverBackground)] rounded-b`}>
|
||||
{/* <ItemSelection filePath={filePath} show /> */}
|
||||
|
||||
<QuickAction
|
||||
title={l10n.t(LocalizationKey.dashboardContentsContentActionsMenuItemView)}
|
||||
className={`text-[var(--frontmatter-secondary-text)]`}
|
||||
onClick={() => openFile(filePath)}>
|
||||
<span className={`sr-only`}>{l10n.t(LocalizationKey.dashboardContentsContentActionsMenuItemView)}</span>
|
||||
<EyeIcon className={`w-4 h-4`} aria-hidden="true" />
|
||||
</QuickAction>
|
||||
|
||||
{
|
||||
websiteUrl && (
|
||||
<QuickAction
|
||||
title={l10n.t(LocalizationKey.commonOpenOnWebsite)}
|
||||
className={`text-[var(--frontmatter-secondary-text)]`}
|
||||
onClick={() => openOnWebsite(websiteUrl, filePath)}>
|
||||
<span className={`sr-only`}>{l10n.t(LocalizationKey.commonOpenOnWebsite)}</span>
|
||||
<GlobeEuropeAfricaIcon className={`w-4 h-4`} aria-hidden="true" />
|
||||
</QuickAction>
|
||||
)
|
||||
}
|
||||
|
||||
<CustomActions
|
||||
filePath={filePath}
|
||||
contentType={contentType}
|
||||
scripts={scripts}
|
||||
showTrigger />
|
||||
|
||||
<QuickAction
|
||||
title={l10n.t(LocalizationKey.commonDelete)}
|
||||
className={`text-[var(--frontmatter-secondary-text)] hover:text-[var(--vscode-statusBarItem-errorBackground)]`}
|
||||
onClick={() => setSelectedItemAction({ path: filePath, action: 'delete' })}>
|
||||
<span className={`sr-only`}>{l10n.t(LocalizationKey.commonDelete)}</span>
|
||||
<TrashIcon className={`w-4 h-4`} aria-hidden="true" />
|
||||
</QuickAction>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
26
src/dashboardWebView/components/Contents/I18nLabel.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import * as React from 'react';
|
||||
import { Page } from '../../models';
|
||||
import { ChevronDownIcon, LanguageIcon } from '@heroicons/react/24/outline';
|
||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '../../../components/shadcn/Dropdown';
|
||||
import { MenuItem } from '../Menu';
|
||||
import { DashboardMessage } from '../../DashboardMessage';
|
||||
import { messageHandler } from '@estruyf/vscode/dist/client';
|
||||
|
||||
export interface II18nLabelProps {
|
||||
page: Page;
|
||||
}
|
||||
|
||||
export const I18nLabel: React.FunctionComponent<II18nLabelProps> = ({
|
||||
page
|
||||
}: React.PropsWithChildren<II18nLabelProps>) => {
|
||||
if (!page.fmLocale) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mb-2 flex items-center">
|
||||
<LanguageIcon className="mr-1 h-4 w-4 inline-block" />
|
||||
<span className="text-xs">{page.fmLocale.title || page.fmLocale.locale}</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -1,10 +1,8 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { MarkdownIcon } from '../../../panelWebView/components/Icons/MarkdownIcon';
|
||||
import { DashboardMessage } from '../../DashboardMessage';
|
||||
import { Page } from '../../models/Page';
|
||||
import { SettingsSelector, ViewSelector } from '../../state';
|
||||
import { DateField } from '../Common/DateField';
|
||||
import { Messenger } from '@estruyf/vscode/dist/client';
|
||||
import { DashboardViewType } from '../../models';
|
||||
import { ContentActions } from './ContentActions';
|
||||
import { useMemo } from 'react';
|
||||
@@ -13,9 +11,14 @@ import * as React from 'react';
|
||||
import useExtensibility from '../../hooks/useExtensibility';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { routePaths } from '../..';
|
||||
import useCard from '../../hooks/useCard';
|
||||
import { I18nLabel } from './I18nLabel';
|
||||
import { ItemSelection } from '../Common/ItemSelection';
|
||||
import { openFile } from '../../utils';
|
||||
import { FooterActions } from './FooterActions';
|
||||
import useSelectedItems from '../../hooks/useSelectedItems';
|
||||
import { cn } from '../../../utils/cn';
|
||||
import { Tags } from './Tags';
|
||||
|
||||
export interface IItemProps extends Page { }
|
||||
|
||||
@@ -24,12 +27,12 @@ const PREVIEW_IMAGE_FIELD = 'fmPreviewImage';
|
||||
export const Item: React.FunctionComponent<IItemProps> = ({
|
||||
...pageData
|
||||
}: React.PropsWithChildren<IItemProps>) => {
|
||||
const { selectedFiles } = useSelectedItems();
|
||||
const view = useRecoilValue(ViewSelector);
|
||||
const settings = useRecoilValue(SettingsSelector);
|
||||
const draftField = useMemo(() => settings?.draftField, [settings]);
|
||||
const cardFields = useMemo(() => settings?.dashboardState?.contents?.cardFields, [settings?.dashboardState?.contents?.cardFields]);
|
||||
const { escapedTitle, escapedDescription } = useCard(pageData, settings?.dashboardState?.contents?.cardFields);
|
||||
const navigate = useNavigate();
|
||||
const { titleHtml, descriptionHtml, dateHtml, statusHtml, tagsHtml, imageHtml, footerHtml } = useExtensibility({
|
||||
fmFilePath: pageData.fmFilePath,
|
||||
date: pageData.date,
|
||||
@@ -39,9 +42,11 @@ export const Item: React.FunctionComponent<IItemProps> = ({
|
||||
pageData
|
||||
});
|
||||
|
||||
const openFile = () => {
|
||||
Messenger.send(DashboardMessage.openFile, pageData.fmFilePath);
|
||||
};
|
||||
const isSelected = useMemo(() => selectedFiles.includes(pageData.fmFilePath), [selectedFiles, pageData.fmFilePath]);
|
||||
|
||||
const onOpenFile = React.useCallback(() => {
|
||||
openFile(pageData.fmFilePath);
|
||||
}, [pageData.fmFilePath]);
|
||||
|
||||
const tags: string[] | undefined = useMemo(() => {
|
||||
if (!settings?.dashboardState?.contents?.tags) {
|
||||
@@ -69,6 +74,34 @@ export const Item: React.FunctionComponent<IItemProps> = ({
|
||||
return [];
|
||||
}, [settings, pageData]);
|
||||
|
||||
const statusPlaceholder = useMemo(() => {
|
||||
if (!statusHtml && !cardFields?.state) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
statusHtml ? (
|
||||
<div dangerouslySetInnerHTML={{ __html: statusHtml }} />
|
||||
) : (
|
||||
cardFields?.state && draftField && draftField.name && typeof pageData[draftField.name] !== "undefined" ? <Status draft={pageData[draftField.name]} published={pageData.fmPublished} /> : null
|
||||
)
|
||||
)
|
||||
}, [statusHtml, cardFields?.state, draftField, pageData]);
|
||||
|
||||
const datePlaceholder = useMemo(() => {
|
||||
if (!dateHtml && !cardFields?.date) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
dateHtml ? (
|
||||
<div className='mr-6' dangerouslySetInnerHTML={{ __html: dateHtml }} />
|
||||
) : (
|
||||
cardFields?.date && pageData.date ? <DateField className={`mr-6`} value={pageData.date} format={pageData.fmDateFormat} /> : null
|
||||
)
|
||||
)
|
||||
}, [dateHtml, cardFields?.date, pageData]);
|
||||
|
||||
const hasDraftOrDate = useMemo(() => {
|
||||
return cardFields && (cardFields.state || cardFields.date);
|
||||
}, [cardFields]);
|
||||
@@ -77,12 +110,12 @@ export const Item: React.FunctionComponent<IItemProps> = ({
|
||||
return (
|
||||
<li className="relative">
|
||||
<div
|
||||
className={`group flex flex-col items-start content-start h-full w-full text-left shadow-md dark:shadow-none hover:shadow-xl border rounded bg-[var(--vscode-sideBar-background)] hover:bg-[var(--vscode-list-hoverBackground)] text-[var(--vscode-sideBarTitle-foreground)] border-[var(--frontmatter-border)]`}
|
||||
className={cn(`group flex flex-col items-start content-start h-full w-full text-left shadow-md dark:shadow-none hover:shadow-xl border rounded bg-[var(--vscode-sideBar-background)] hover:bg-[var(--vscode-list-hoverBackground)] text-[var(--vscode-sideBarTitle-foreground)] border-[var(--frontmatter-border)]`, isSelected && `border-[var(--frontmatter-border-active)]`)}
|
||||
>
|
||||
<button
|
||||
onClick={openFile}
|
||||
className={`relative h-36 w-full overflow-hidden border-b cursor-pointer border-[var(--frontmatter-border)]
|
||||
}`}
|
||||
title={escapedTitle ? l10n.t(LocalizationKey.commonOpenWithValue, escapedTitle) : l10n.t(LocalizationKey.commonOpen)}
|
||||
onClick={onOpenFile}
|
||||
className={`relative rounded-t h-36 w-full overflow-hidden border-b cursor-pointer border-[var(--frontmatter-border)]`}
|
||||
>
|
||||
{
|
||||
imageHtml ?
|
||||
@@ -104,80 +137,68 @@ export const Item: React.FunctionComponent<IItemProps> = ({
|
||||
}
|
||||
</button>
|
||||
|
||||
<div className="relative p-4 w-full grow">
|
||||
<div className={`flex justify-between items-center ${hasDraftOrDate ? `mb-2` : ``}`}>
|
||||
{
|
||||
statusHtml ? (
|
||||
<div dangerouslySetInnerHTML={{ __html: statusHtml }} />
|
||||
) : (
|
||||
cardFields?.state && draftField && draftField.name && <Status draft={pageData[draftField.name]} published={pageData.fmPublished} />
|
||||
)
|
||||
}
|
||||
<ItemSelection filePath={pageData.fmFilePath} />
|
||||
|
||||
{
|
||||
dateHtml ? (
|
||||
<div className='mr-4' dangerouslySetInnerHTML={{ __html: dateHtml }} />
|
||||
) : (
|
||||
cardFields?.date && <DateField className={`mr-4`} value={pageData.date} format={pageData.fmDateFormat} />
|
||||
)
|
||||
}
|
||||
</div>
|
||||
<div className="relative p-4 w-full grow">
|
||||
{
|
||||
(statusPlaceholder || datePlaceholder) && (
|
||||
<div className={`space-y-2 ${hasDraftOrDate ? `mb-2` : ``}`}>
|
||||
<div>{statusPlaceholder}</div>
|
||||
<div>{datePlaceholder}</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
<ContentActions
|
||||
title={pageData.title}
|
||||
path={pageData.fmFilePath}
|
||||
relPath={pageData.fmRelFileWsPath}
|
||||
contentType={pageData.fmContentType}
|
||||
locale={pageData.fmLocale}
|
||||
isDefaultLocale={pageData.fmDefaultLocale}
|
||||
translations={pageData.fmTranslations}
|
||||
scripts={settings?.scripts}
|
||||
onOpen={openFile}
|
||||
onOpen={onOpenFile}
|
||||
/>
|
||||
|
||||
<button onClick={openFile} className={`text-left block`}>
|
||||
<I18nLabel page={pageData} />
|
||||
|
||||
<button
|
||||
title={escapedTitle ? l10n.t(LocalizationKey.commonOpenWithValue, escapedTitle) : l10n.t(LocalizationKey.commonOpen)}
|
||||
onClick={onOpenFile}
|
||||
className={`text-left block`}>
|
||||
{
|
||||
titleHtml ? (
|
||||
<div dangerouslySetInnerHTML={{ __html: titleHtml }} />
|
||||
) : (
|
||||
<h2 className="mb-2 font-bold">
|
||||
{escapedTitle}
|
||||
<h2 className="font-bold">
|
||||
<span>{escapedTitle}</span>
|
||||
</h2>
|
||||
)
|
||||
}
|
||||
</button>
|
||||
|
||||
<button onClick={openFile} className={`text-left block`}>
|
||||
{
|
||||
descriptionHtml ? (
|
||||
<div dangerouslySetInnerHTML={{ __html: descriptionHtml }} />
|
||||
) : (
|
||||
<p className={`text-xs text-[vara(--vscode-titleBar-activeForeground)]`}>{escapedDescription}</p>
|
||||
)
|
||||
}
|
||||
</button>
|
||||
{
|
||||
(escapedDescription || descriptionHtml) && (
|
||||
<button
|
||||
title={escapedTitle ? l10n.t(LocalizationKey.commonOpenWithValue, escapedTitle) : l10n.t(LocalizationKey.commonOpen)}
|
||||
onClick={onOpenFile}
|
||||
className={`mt-2 text-left block`}>
|
||||
{
|
||||
descriptionHtml ? (
|
||||
<div dangerouslySetInnerHTML={{ __html: descriptionHtml }} />
|
||||
) : (
|
||||
<p className={`text-xs text-[var(--frontmatter-secondary-text)]`}>{escapedDescription}</p>
|
||||
)
|
||||
}
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
{
|
||||
tagsHtml ? (
|
||||
<div className="mt-2" dangerouslySetInnerHTML={{ __html: tagsHtml }} />
|
||||
) : (
|
||||
tags && tags.length > 0 && (
|
||||
<div className="mt-2">
|
||||
{tags.map(
|
||||
(tag, index) => tag && (
|
||||
<button
|
||||
key={index}
|
||||
className={`inline-block mr-1 mt-1 text-xs text-[var(--vscode-textPreformat-foreground)] hover:brightness-75 hover:underline hover:underline-offset-1`}
|
||||
title={l10n.t(LocalizationKey.commonFilterValue, tag)}
|
||||
onClick={() => {
|
||||
const tagField = settings?.dashboardState.contents.tags;
|
||||
if (tagField) {
|
||||
navigate(`${routePaths.contents}?taxonomy=${tagField}&value=${tag}`);
|
||||
}
|
||||
}}
|
||||
>
|
||||
#{tag}
|
||||
</button>
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
<Tags values={tags} tagField={settings?.dashboardState?.contents?.tags} />
|
||||
)
|
||||
}
|
||||
</div>
|
||||
@@ -187,6 +208,12 @@ export const Item: React.FunctionComponent<IItemProps> = ({
|
||||
<div className="placeholder__card__footer p-4 w-full" dangerouslySetInnerHTML={{ __html: footerHtml }} />
|
||||
)
|
||||
}
|
||||
|
||||
<FooterActions
|
||||
filePath={pageData.fmFilePath}
|
||||
contentType={pageData.fmContentType}
|
||||
websiteUrl={settings?.websiteUrl}
|
||||
scripts={settings?.scripts} />
|
||||
</div>
|
||||
</li>
|
||||
);
|
||||
@@ -197,16 +224,20 @@ export const Item: React.FunctionComponent<IItemProps> = ({
|
||||
className={`px-5 cursor-pointer w-full text-left grid grid-cols-12 gap-x-4 sm:gap-x-6 xl:gap-x-8 py-2 border-b hover:bg-opacity-70 border-[var(--frontmatter-border)] hover:bg-[var(--vscode-sideBar-background)]`}
|
||||
>
|
||||
<div className="col-span-8 font-bold truncate flex items-center space-x-4">
|
||||
<button title={`Open: ${escapedTitle}`} onClick={openFile}>
|
||||
<ItemSelection filePath={pageData.fmFilePath} show />
|
||||
|
||||
<button
|
||||
title={escapedTitle ? l10n.t(LocalizationKey.commonOpenWithValue, escapedTitle) : l10n.t(LocalizationKey.commonOpen)}
|
||||
onClick={onOpenFile}>
|
||||
{escapedTitle}
|
||||
</button>
|
||||
|
||||
<ContentActions
|
||||
title={escapedTitle || ""}
|
||||
path={pageData.fmFilePath}
|
||||
relPath={pageData.fmRelFileWsPath}
|
||||
contentType={pageData.fmContentType}
|
||||
scripts={settings?.scripts}
|
||||
onOpen={openFile}
|
||||
onOpen={onOpenFile}
|
||||
listView
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import useThemeColors from '../../hooks/useThemeColors';
|
||||
import { DashboardViewType } from '../../models';
|
||||
import { ViewSelector } from '../../state';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
@@ -12,11 +11,10 @@ export const List: React.FunctionComponent<IListProps> = ({
|
||||
children
|
||||
}: React.PropsWithChildren<IListProps>) => {
|
||||
const view = useRecoilValue(ViewSelector);
|
||||
const { getColors } = useThemeColors();
|
||||
|
||||
let className = '';
|
||||
if (view === DashboardViewType.Grid) {
|
||||
className = `grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4`;
|
||||
className = `grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 2xl:grid-cols-5 gap-4`;
|
||||
} else if (view === DashboardViewType.List) {
|
||||
className = `-mx-4`;
|
||||
}
|
||||
@@ -24,8 +22,7 @@ export const List: React.FunctionComponent<IListProps> = ({
|
||||
return (
|
||||
<ul role="list" className={className}>
|
||||
{view === DashboardViewType.List && (
|
||||
<li className={`px-5 relative uppercase py-2 border-b ${getColors('text-vulcan-100 dark:text-whisper-900 border-vulcan-50', 'text-[var(--vscode-editor-foreground)] border-[var(--frontmatter-border)]')
|
||||
}`}>
|
||||
<li className={`px-5 relative uppercase py-2 border-b text-[var(--vscode-editor-foreground)] border-[var(--frontmatter-border)]`}>
|
||||
<div className={`grid grid-cols-12 gap-x-4 sm:gap-x-6 xl:gap-x-8`}>
|
||||
<div className="col-span-8">{l10n.t(LocalizationKey.dashboardContentsListTitle)}</div>
|
||||
<div className="col-span-2">{l10n.t(LocalizationKey.dashboardContentsListDate)}</div>
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
import { Disclosure } from '@headlessui/react';
|
||||
import { ChevronRightIcon } from '@heroicons/react/solid';
|
||||
import { ChevronRightIcon } from '@heroicons/react/24/solid';
|
||||
import * as React from 'react';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { useRecoilState, useRecoilValue } from 'recoil';
|
||||
import { groupBy } from '../../../helpers/GroupBy';
|
||||
import { FrontMatterIcon } from '../../../panelWebView/components/Icons/FrontMatterIcon';
|
||||
import { GroupOption } from '../../constants/GroupOption';
|
||||
import { Page } from '../../models/Page';
|
||||
import { Settings } from '../../models/Settings';
|
||||
import { GroupingSelector, PageAtom, ViewSelector } from '../../state';
|
||||
import { Item } from './Item';
|
||||
import { List } from './List';
|
||||
import usePagination from '../../hooks/usePagination';
|
||||
import useThemeColors from '../../hooks/useThemeColors';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
import { PinnedItemsAtom } from '../../state/atom/PinnedItems';
|
||||
@@ -20,7 +17,7 @@ import { messageHandler } from '@estruyf/vscode/dist/client';
|
||||
import { DashboardMessage } from '../../DashboardMessage';
|
||||
import { PinIcon } from '../Icons/PinIcon';
|
||||
import { PinnedItem } from './PinnedItem';
|
||||
import { DashboardViewType } from '../../models';
|
||||
import { DashboardViewType, Page, Settings } from '../../models';
|
||||
|
||||
export interface IOverviewProps {
|
||||
pages: Page[];
|
||||
@@ -36,7 +33,6 @@ export const Overview: React.FunctionComponent<IOverviewProps> = ({
|
||||
const grouping = useRecoilValue(GroupingSelector);
|
||||
const page = useRecoilValue(PageAtom);
|
||||
const { pageSetNr } = usePagination(settings?.dashboardState.contents.pagination);
|
||||
const { getColors } = useThemeColors();
|
||||
const view = useRecoilValue(ViewSelector);
|
||||
|
||||
const pagedPages = useMemo(() => {
|
||||
@@ -123,8 +119,7 @@ export const Overview: React.FunctionComponent<IOverviewProps> = ({
|
||||
<div className={`flex items-center justify-center h-full`}>
|
||||
<div className={`max-w-xl text-center`}>
|
||||
<FrontMatterIcon
|
||||
className={`h-32 mx-auto opacity-90 mb-8 ${getColors('text-vulcan-300 dark:text-whisper-800', 'text-[var(--vscode-editor-foreground)]')
|
||||
}`}
|
||||
className={`h-32 mx-auto opacity-90 mb-8 text-[var(--vscode-editor-foreground)]`}
|
||||
/>
|
||||
{settings && settings?.contentFolders?.length > 0 ? (
|
||||
<p className={`text-xl font-medium`}>{l10n.t(LocalizationKey.dashboardContentsOverviewNoMarkdown)}</p>
|
||||
|
||||
@@ -2,27 +2,32 @@ import * as React from 'react';
|
||||
import { Page } from '../../models';
|
||||
import { MarkdownIcon } from '../../../panelWebView/components/Icons/MarkdownIcon';
|
||||
import { ContentActions } from './ContentActions';
|
||||
import { DashboardMessage } from '../../DashboardMessage';
|
||||
import { messageHandler } from '@estruyf/vscode/dist/client';
|
||||
import useCard from '../../hooks/useCard';
|
||||
import { SettingsSelector } from '../../state';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { ItemSelection } from '../Common/ItemSelection';
|
||||
import { openFile } from '../../utils';
|
||||
import useSelectedItems from '../../hooks/useSelectedItems';
|
||||
import { cn } from '../../../utils/cn';
|
||||
|
||||
export interface IPinnedItemProps extends Page { }
|
||||
|
||||
export const PinnedItem: React.FunctionComponent<IPinnedItemProps> = ({
|
||||
...pageData
|
||||
}: React.PropsWithChildren<IPinnedItemProps>) => {
|
||||
const { selectedFiles } = useSelectedItems();
|
||||
const settings = useRecoilValue(SettingsSelector);
|
||||
const { escapedTitle } = useCard(pageData, settings?.dashboardState?.contents?.cardFields);
|
||||
|
||||
const openFile = React.useCallback(() => {
|
||||
messageHandler.send(DashboardMessage.openFile, pageData.fmFilePath);
|
||||
const isSelected = React.useMemo(() => selectedFiles.includes(pageData.fmFilePath), [selectedFiles, pageData.fmFilePath]);
|
||||
|
||||
const onOpenFile = React.useCallback(() => {
|
||||
openFile(pageData.fmFilePath);
|
||||
}, [pageData.fmFilePath]);
|
||||
|
||||
return (
|
||||
<li className='group flex w-full border border-[var(--frontmatter-border)] rounded bg-[var(--vscode-sideBar-background)] hover:bg-[var(--vscode-list-hoverBackground)] text-[var(--vscode-sideBarTitle-foreground)]'>
|
||||
<button onClick={openFile} className='relative h-full w-1/3'>
|
||||
<li className={cn(`group flex w-full border border-[var(--frontmatter-border)] rounded bg-[var(--vscode-sideBar-background)] hover:bg-[var(--vscode-list-hoverBackground)] text-[var(--vscode-sideBarTitle-foreground)] relative`, isSelected && `border-[var(--frontmatter-border-active)]`)}>
|
||||
<button onClick={onOpenFile} className='relative h-full w-1/3'>
|
||||
{
|
||||
pageData["fmPreviewImage"] ? (
|
||||
<img
|
||||
@@ -41,13 +46,15 @@ export const PinnedItem: React.FunctionComponent<IPinnedItemProps> = ({
|
||||
}
|
||||
</button>
|
||||
|
||||
<button onClick={openFile} className='relative w-2/3 p-4 pr-6 text-left flex items-start'>
|
||||
<ItemSelection filePath={pageData.fmFilePath} />
|
||||
|
||||
<button onClick={onOpenFile} className='relative w-2/3 p-4 pr-6 text-left flex items-start'>
|
||||
<p className='font-bold'>{escapedTitle}</p>
|
||||
|
||||
<ContentActions
|
||||
title={pageData.title}
|
||||
path={pageData.fmFilePath}
|
||||
relPath={pageData.fmRelFileWsPath}
|
||||
contentType={pageData.fmContentType}
|
||||
scripts={settings?.scripts}
|
||||
onOpen={openFile}
|
||||
/>
|
||||
|
||||
@@ -34,7 +34,7 @@ export const Status: React.FunctionComponent<IStatusProps> = ({
|
||||
if (draftValue) {
|
||||
return (
|
||||
<span
|
||||
className={`inline-block px-1 py-1 leading-none rounded-sm font-semibold uppercase tracking-wide text-[0.7rem] text-[var(--vscode-badge-foreground)] bg-[var(--vscode-badge-background)]`}
|
||||
className={`inline-block px-[3px] py-[2px] rounded font-semibold uppercase tracking-wide text-[0.7rem] text-[var(--vscode-badge-foreground)] bg-[var(--vscode-badge-background)]`}
|
||||
>
|
||||
{draftValue}
|
||||
</span>
|
||||
@@ -51,7 +51,7 @@ export const Status: React.FunctionComponent<IStatusProps> = ({
|
||||
return (
|
||||
<span
|
||||
className={`draft__status
|
||||
inline-block px-1 py-1 leading-none rounded-sm font-semibold uppercase tracking-wide text-[0.7rem]
|
||||
inline-block px-[3px] py-[2px] rounded font-semibold uppercase tracking-wide text-[0.7rem]
|
||||
${draftValue ?
|
||||
'bg-[var(--vscode-statusBarItem-errorBackground)] text-[var(--vscode-statusBarItem-errorForeground)]' :
|
||||
isFuture ?
|
||||
|
||||
35
src/dashboardWebView/components/Contents/Tag.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import * as React from 'react';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { routePaths } from '../..';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
export interface ITagProps {
|
||||
value?: string;
|
||||
tagField?: string | null | undefined;
|
||||
}
|
||||
|
||||
export const Tag: React.FunctionComponent<ITagProps> = ({
|
||||
value,
|
||||
tagField
|
||||
}: React.PropsWithChildren<ITagProps>) => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
if (!value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<button
|
||||
className={`inline-block mr-1 mt-1 text-xs text-[var(--vscode-button-secondaryForeground)] bg-[var(--vscode-button-secondaryBackground)] hover:bg-[var(--vscode-button-secondaryHoverBackground)] border border-[var(--frontmatter-border)] rounded px-1 py-0.5`}
|
||||
title={l10n.t(LocalizationKey.commonFilterValue, value)}
|
||||
onClick={() => {
|
||||
if (tagField) {
|
||||
navigate(`${routePaths.contents}?taxonomy=${tagField}&value=${value}`);
|
||||
}
|
||||
}}
|
||||
>
|
||||
#{value}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
29
src/dashboardWebView/components/Contents/Tags.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import * as React from 'react';
|
||||
import { Tag } from './Tag';
|
||||
|
||||
export interface ITagsProps {
|
||||
values?: string[];
|
||||
tagField?: string | null | undefined;
|
||||
}
|
||||
|
||||
export const Tags: React.FunctionComponent<ITagsProps> = ({
|
||||
values,
|
||||
tagField
|
||||
}: React.PropsWithChildren<ITagsProps>) => {
|
||||
if (!values || values.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mt-2">
|
||||
{values.map(
|
||||
(tag, index) => tag && (
|
||||
<Tag
|
||||
key={index}
|
||||
value={tag}
|
||||
tagField={tagField} />
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
80
src/dashboardWebView/components/Contents/TranslationMenu.tsx
Normal file
@@ -0,0 +1,80 @@
|
||||
import * as React from 'react';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { DropdownMenuItem, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger } from '../../../components/shadcn/Dropdown';
|
||||
import { LanguageIcon } from '@heroicons/react/24/outline';
|
||||
import { openFile } from '../../utils/MessageHandlers';
|
||||
import { I18nConfig } from '../../../models';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
|
||||
export interface ITranslationMenuProps {
|
||||
isDefaultLocale?: boolean;
|
||||
locale?: I18nConfig;
|
||||
translations?: {
|
||||
[locale: string]: {
|
||||
locale: I18nConfig;
|
||||
path: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export const TranslationMenu: React.FunctionComponent<ITranslationMenuProps> = ({
|
||||
isDefaultLocale,
|
||||
locale,
|
||||
translations,
|
||||
}: React.PropsWithChildren<ITranslationMenuProps>) => {
|
||||
|
||||
const otherLocales = React.useMemo(() => {
|
||||
if (!translations) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return Object.entries(translations).filter(([key]) => key !== locale?.locale);
|
||||
}, [translations]);
|
||||
|
||||
const crntLocale = React.useMemo(() => {
|
||||
if (!locale?.locale || !translations || !translations[locale.locale]) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return translations[locale.locale];
|
||||
}, [translations, locale]);
|
||||
|
||||
|
||||
if (!locale || !translations || Object.keys(translations).length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (otherLocales.length === 0 || !crntLocale) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<DropdownMenuSub>
|
||||
<DropdownMenuSubTrigger>
|
||||
<LanguageIcon className={`mr-2 h-4 w-4`} aria-hidden={true} />
|
||||
<span>{l10n.t(LocalizationKey.dashboardContentsContentActionsTranslationsMenu)}</span>
|
||||
</DropdownMenuSubTrigger>
|
||||
|
||||
<DropdownMenuPortal>
|
||||
<DropdownMenuSubContent>
|
||||
<DropdownMenuItem onClick={() => openFile(crntLocale.path)}>
|
||||
<span>{crntLocale.locale.title || crntLocale.locale.locale}</span>
|
||||
</DropdownMenuItem>
|
||||
|
||||
<DropdownMenuSeparator />
|
||||
|
||||
{
|
||||
otherLocales.map(([key, value]) => (
|
||||
<DropdownMenuItem
|
||||
key={key}
|
||||
onClick={() => openFile(value.path)}
|
||||
>
|
||||
<span>{value.locale.title || value.locale.locale}</span>
|
||||
</DropdownMenuItem>
|
||||
))
|
||||
}
|
||||
</DropdownMenuSubContent>
|
||||
</DropdownMenuPortal>
|
||||
</DropdownMenuSub>
|
||||
);
|
||||
};
|
||||
@@ -1,10 +1,9 @@
|
||||
import * as React from 'react';
|
||||
import { useForm } from 'uniforms';
|
||||
import { SubmitField } from 'uniforms-unstyled';
|
||||
import useThemeColors from '../../hooks/useThemeColors';
|
||||
import { Button } from '../Common/Button';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
import { SubmitField } from '../../../components/uniforms-frontmatter';
|
||||
|
||||
export interface IDataFormControlsProps {
|
||||
model: any | null;
|
||||
@@ -16,10 +15,9 @@ export const DataFormControls: React.FunctionComponent<IDataFormControlsProps> =
|
||||
onClear
|
||||
}: React.PropsWithChildren<IDataFormControlsProps>) => {
|
||||
const { formRef } = useForm();
|
||||
const { getColors } = useThemeColors();
|
||||
|
||||
return (
|
||||
<div className={`text-right ${getColors(`border-gray-200 dark:border-vulcan-300`, `border-[var(--frontmatter-border)]`)}`}>
|
||||
<div className={`text-right border-[var(--frontmatter-border)]`}>
|
||||
<SubmitField value={model ? `Update` : `Add`} />
|
||||
|
||||
<Button
|
||||
|
||||
@@ -15,27 +15,25 @@ import { arrayMoveImmutable } from 'array-move';
|
||||
import { EmptyView } from './EmptyView';
|
||||
import { Container } from './SortableContainer';
|
||||
import { SortableItem } from './SortableItem';
|
||||
import { ChevronRightIcon, DatabaseIcon } from '@heroicons/react/outline';
|
||||
import { ToastContainer, toast, Slide } from 'react-toastify';
|
||||
import 'react-toastify/dist/ReactToastify.css';
|
||||
import { ChevronRightIcon, CircleStackIcon } from '@heroicons/react/24/outline';
|
||||
import { DataType } from '../../../models/DataType';
|
||||
import { TelemetryEvent } from '../../../constants';
|
||||
import { GeneralCommands, TelemetryEvent, WEBSITE_LINKS } from '../../../constants';
|
||||
import { NavigationItem } from '../Layout';
|
||||
import useThemeColors from '../../hooks/useThemeColors';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
import { NavigationType } from '../../models';
|
||||
import { DropdownMenu, DropdownMenuContent } from '../../../components/shadcn/Dropdown';
|
||||
import { MenuButton, MenuItem } from '../Menu';
|
||||
import { Transition } from '@headlessui/react';
|
||||
|
||||
export interface IDataViewProps { }
|
||||
|
||||
export const DataView: React.FunctionComponent<IDataViewProps> = (
|
||||
props: React.PropsWithChildren<IDataViewProps>
|
||||
_: React.PropsWithChildren<IDataViewProps>
|
||||
) => {
|
||||
const [selectedData, setSelectedData] = useState<DataFile | null>(null);
|
||||
const [selectedIndex, setSelectedIndex] = useState<number | null>(null);
|
||||
const [dataEntries, setDataEntries] = useState<any | any[] | null>(null);
|
||||
const settings = useRecoilValue(SettingsSelector);
|
||||
const { getColors } = useThemeColors();
|
||||
|
||||
const setSchema = (dataFile: DataFile) => {
|
||||
setSelectedData(dataFile);
|
||||
@@ -112,15 +110,7 @@ export const DataView: React.FunctionComponent<IDataViewProps> = (
|
||||
entries: data
|
||||
});
|
||||
|
||||
// Show toast message
|
||||
toast.success('Updated your data entries', {
|
||||
position: 'top-right',
|
||||
autoClose: 2000,
|
||||
hideProgressBar: true,
|
||||
closeOnClick: true,
|
||||
pauseOnHover: false,
|
||||
transition: Slide
|
||||
});
|
||||
Messenger.send(DashboardMessage.showNotification, l10n.t(LocalizationKey.dashboardDataViewDataViewUpdateMessage));
|
||||
},
|
||||
[selectedData]
|
||||
);
|
||||
@@ -138,10 +128,17 @@ export const DataView: React.FunctionComponent<IDataViewProps> = (
|
||||
useEffect(() => {
|
||||
Messenger.listen(messageListener);
|
||||
|
||||
Messenger.send(DashboardMessage.setTitle, l10n.t(LocalizationKey.dashboardHeaderTabsData));
|
||||
|
||||
Messenger.send(DashboardMessage.sendTelemetry, {
|
||||
event: TelemetryEvent.webviewDataView
|
||||
});
|
||||
|
||||
Messenger.send(GeneralCommands.toVSCode.logging.info, {
|
||||
message: 'Data view loaded',
|
||||
location: 'DASHBOARD'
|
||||
});
|
||||
|
||||
return () => {
|
||||
Messenger.unlisten(messageListener);
|
||||
};
|
||||
@@ -174,65 +171,78 @@ export const DataView: React.FunctionComponent<IDataViewProps> = (
|
||||
<div className="flex flex-col h-full overflow-auto inset-y-0">
|
||||
<Header settings={settings} />
|
||||
|
||||
{settings?.dataFiles && settings.dataFiles.length > 0 ? (
|
||||
<div className="relative w-full flex-grow mx-auto overflow-hidden">
|
||||
<div className={`flex w-64 flex-col absolute inset-y-0`}>
|
||||
<aside
|
||||
className={`flex flex-col flex-grow overflow-y-auto border-r py-6 px-4 overflow-auto ${getColors(
|
||||
'border-gray-200 dark:border-vulcan-300',
|
||||
'border-[var(--frontmatter-border)]'
|
||||
)
|
||||
}`}
|
||||
>
|
||||
<h2 className={`text-lg ${getColors(
|
||||
`text-gray-500 dark:text-whisper-900`,
|
||||
`text-[var(--frontmatter-text)]`
|
||||
)
|
||||
}`}>
|
||||
{l10n.t(LocalizationKey.dashboardDataViewDataViewSelect)}
|
||||
</h2>
|
||||
|
||||
<nav className={`flex-1 py-4 -mx-4`}>
|
||||
<div
|
||||
className={`divide-y border-t border-b ${getColors(
|
||||
`divide-gray-200 dark:divide-vulcan-300 border-gray-200 dark:border-vulcan-300`,
|
||||
`divide-[var(--frontmatter-border)] border-[var(--frontmatter-border)]`
|
||||
)
|
||||
}`}
|
||||
{dataFiles && dataFiles.length > 0 ? (
|
||||
<div className={`relative w-full flex-grow mx-auto overflow-hidden`}>
|
||||
{
|
||||
!selectedData && (
|
||||
<div className={`flex w-64 flex-col absolute inset-y-0`}>
|
||||
<aside
|
||||
className={`flex flex-col flex-grow overflow-y-auto border-r py-6 px-4 overflow-auto border-[var(--frontmatter-border)]`}
|
||||
>
|
||||
{dataFiles &&
|
||||
dataFiles.length > 0 &&
|
||||
dataFiles.map((dataFile, idx) => (
|
||||
<NavigationItem
|
||||
key={`${dataFile.id}-${idx}`}
|
||||
isSelected={selectedData?.id === dataFile.id}
|
||||
onClick={() => setSchema(dataFile)}
|
||||
>
|
||||
<ChevronRightIcon className="-ml-1 w-5 mr-2" />
|
||||
<span>{dataFile.title}</span>
|
||||
</NavigationItem>
|
||||
))}
|
||||
</div>
|
||||
</nav>
|
||||
</aside>
|
||||
</div>
|
||||
<h2 className={`text-lg text-[var(--frontmatter-text)]`}>
|
||||
{l10n.t(LocalizationKey.dashboardDataViewDataViewSelect)}
|
||||
</h2>
|
||||
|
||||
<section className={`pl-64 flex min-w-0 h-full`}>
|
||||
<nav className={`flex-1 py-4 -mx-4`}>
|
||||
<div
|
||||
className={`divide-y border-t border-b divide-[var(--frontmatter-border)] border-[var(--frontmatter-border)]`}
|
||||
>
|
||||
{dataFiles &&
|
||||
dataFiles.length > 0 &&
|
||||
dataFiles.map((dataFile, idx) => (
|
||||
<NavigationItem
|
||||
key={`${dataFile.id}-${idx}`}
|
||||
onClick={() => setSchema(dataFile)}
|
||||
>
|
||||
<ChevronRightIcon className="-ml-1 w-5 mr-2" />
|
||||
<span>{dataFile.title}</span>
|
||||
</NavigationItem>
|
||||
))}
|
||||
</div>
|
||||
</nav>
|
||||
</aside>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
<Transition
|
||||
as={`div`}
|
||||
show={!!selectedData}
|
||||
enter="transition ease transform"
|
||||
enterFrom="opacity-0"
|
||||
enterTo="opacity-100">
|
||||
<div className={`w-full px-4 py-2 border-b border-[var(--frontmatter-border)]`}>
|
||||
{selectedData && (
|
||||
<DropdownMenu>
|
||||
<MenuButton
|
||||
label={l10n.t(LocalizationKey.dashboardDataViewDataViewSelect)}
|
||||
title={selectedData.title}
|
||||
/>
|
||||
|
||||
<DropdownMenuContent>
|
||||
{dataFiles.map((dataFile) => (
|
||||
<MenuItem
|
||||
key={dataFile.id}
|
||||
title={dataFile.title}
|
||||
value={dataFile}
|
||||
isCurrent={selectedData.id === dataFile.id}
|
||||
onClick={() => setSchema(dataFile)}
|
||||
/>
|
||||
))}
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
)}
|
||||
</div>
|
||||
</Transition>
|
||||
|
||||
<section className={`flex min-w-0 h-full ease transition-[padding] ${selectedData ? "" : "pl-64"}`}>
|
||||
{selectedData ? (
|
||||
<>
|
||||
{!selectedData.singleEntry && (
|
||||
<div
|
||||
className={`w-1/3 py-6 px-4 flex-1 border-r overflow-auto ${getColors(
|
||||
`border-gray-200 dark:border-vulcan-300`,
|
||||
`border-[var(--frontmatter-border)]`
|
||||
)
|
||||
}`}
|
||||
className={`w-1/3 py-6 px-4 flex-1 border-r overflow-auto border-[var(--frontmatter-border)]`}
|
||||
>
|
||||
<h2 className={`text-lg ${getColors(
|
||||
`text-gray-500 dark:text-whisper-900`,
|
||||
`text-[var(--frontmatter-text)]`
|
||||
)
|
||||
}`}>
|
||||
<h2 className={`text-lg text-[var(--frontmatter-text)]`}>
|
||||
{l10n.t(LocalizationKey.dashboardDataViewDataViewTitle, selectedData?.title?.toLowerCase() || '')}
|
||||
</h2>
|
||||
|
||||
@@ -258,7 +268,7 @@ export const DataView: React.FunctionComponent<IDataViewProps> = (
|
||||
</>
|
||||
) : (
|
||||
<div className={`flex flex-col items-center justify-center`}>
|
||||
<p className={getColors(`text-gray-500 dark:text-whisper-900`, `text-[var(--frontmatter-text)]`)}>
|
||||
<p className={`text-[var(--frontmatter-text)]`}>
|
||||
{l10n.t(LocalizationKey.dashboardDataViewDataViewEmpty, selectedData.title.toLowerCase())}
|
||||
</p>
|
||||
</div>
|
||||
@@ -270,7 +280,7 @@ export const DataView: React.FunctionComponent<IDataViewProps> = (
|
||||
className={`${selectedData.singleEntry ? 'w-full' : 'w-2/3'
|
||||
} py-6 px-4 overflow-auto`}
|
||||
>
|
||||
<h2 className={`text-lg ${getColors(`text-gray-500 dark:text-whisper-900`, `text-[var(--frontmatter-text)]`)}`}>
|
||||
<h2 className={`text-lg text-[var(--frontmatter-text)]`}>
|
||||
{l10n.t(LocalizationKey.dashboardDataViewDataViewCreateOrModify, selectedData.title.toLowerCase())}
|
||||
</h2>
|
||||
{selectedData ? (
|
||||
@@ -292,17 +302,13 @@ export const DataView: React.FunctionComponent<IDataViewProps> = (
|
||||
</div>
|
||||
) : (
|
||||
<div className="w-full h-full flex items-center justify-center">
|
||||
<div className={`flex flex-col items-center ${getColors(
|
||||
'text-gray-500 dark:text-whisper-900',
|
||||
'text-[var(--frontmatter-text)]'
|
||||
)
|
||||
}`}>
|
||||
<DatabaseIcon className="w-32 h-32" />
|
||||
<div className={`flex flex-col items-center text-[var(--frontmatter-text)]`}>
|
||||
<CircleStackIcon className="w-32 h-32" />
|
||||
<p className="text-3xl mt-2">{l10n.t(LocalizationKey.dashboardDataViewDataViewNoDataFiles)}</p>
|
||||
<p className="text-xl mt-4">
|
||||
<a
|
||||
className={getColors(`text-teal-700 hover:text-teal-900`, `text-[var(--frontmatter-link)] hover:text-[var(--frontmatter-link-hover)]`)}
|
||||
href={`https://frontmatter.codes/docs/dashboard#data-files-view`}
|
||||
className={`text-[var(--frontmatter-link)] hover:text-[var(--frontmatter-link-hover)]`}
|
||||
href={WEBSITE_LINKS.docs.dataDashboard}
|
||||
title={l10n.t(LocalizationKey.dashboardDataViewDataViewGetStartedLink)}
|
||||
>
|
||||
{l10n.t(LocalizationKey.dashboardDataViewDataViewGetStartedLink)}
|
||||
@@ -319,8 +325,6 @@ export const DataView: React.FunctionComponent<IDataViewProps> = (
|
||||
isBacker={settings?.isBacker}
|
||||
/>
|
||||
|
||||
<ToastContainer />
|
||||
|
||||
<img className='hidden' src="https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Ffrontmatter.codes%2Fmetrics%2Fdashboards&slug=DataView" alt="DataView metrics" />
|
||||
</div >
|
||||
);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { ExclamationCircleIcon } from '@heroicons/react/outline';
|
||||
import { ExclamationCircleIcon } from '@heroicons/react/24/outline';
|
||||
import * as React from 'react';
|
||||
import useThemeColors from '../../hooks/useThemeColors';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
|
||||
@@ -9,12 +8,11 @@ export interface IEmptyViewProps { }
|
||||
export const EmptyView: React.FunctionComponent<IEmptyViewProps> = (
|
||||
props: React.PropsWithChildren<IEmptyViewProps>
|
||||
) => {
|
||||
const { getColors } = useThemeColors();
|
||||
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center w-full">
|
||||
<ExclamationCircleIcon className={`w-1/12 opacity-90 ${getColors(`text-gray-500 dark:text-whisper-900`, `text-[var(--frontmatter-secondary-text)]`)}`} />
|
||||
<h2 className={`text-xl ${getColors(`text-gray-500 dark:text-whisper-900`, `text-[var(--frontmatter-secondary-text)]`)}`}>
|
||||
<ExclamationCircleIcon className={`w-1/12 opacity-90 text-[var(--frontmatter-secondary-text)]`} />
|
||||
<h2 className={`text-xl text-[var(--frontmatter-secondary-text)]`}>
|
||||
{l10n.t(LocalizationKey.dashboardDataViewEmptyViewHeading)}
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
import * as React from 'react';
|
||||
import { SortableContainer } from 'react-sortable-hoc';
|
||||
import useThemeColors from '../../hooks/useThemeColors';
|
||||
|
||||
export interface ISortableContainerProps { }
|
||||
|
||||
export const Container = SortableContainer(
|
||||
({ children }: React.PropsWithChildren<ISortableContainerProps>) => {
|
||||
const { getColors } = useThemeColors();
|
||||
|
||||
return (
|
||||
<ul
|
||||
className={`-mx-4 divide-y border-t border-b ${getColors(`divide-gray-200 dark:divide-vulcan-300 border-gray-200 dark:border-vulcan-300`, `divide-[var(--frontmatter-border)] border-[var(--frontmatter-border)]`)
|
||||
}`}
|
||||
className={`-mx-4 divide-y border-t border-b divide-[var(--frontmatter-border)] border-[var(--frontmatter-border)]`}
|
||||
>
|
||||
{children}
|
||||
</ul>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { PencilIcon, SelectorIcon, TrashIcon } from '@heroicons/react/outline';
|
||||
import { PencilIcon, TrashIcon, ChevronUpDownIcon } from '@heroicons/react/24/outline';
|
||||
import * as React from 'react';
|
||||
import { SortableHandle, SortableElement } from 'react-sortable-hoc';
|
||||
import useThemeColors from '../../hooks/useThemeColors';
|
||||
import { LinkButton } from '../Common/LinkButton';
|
||||
import { Alert } from '../Modals/Alert';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
@@ -16,7 +15,7 @@ export interface ISortableItemProps {
|
||||
onDeleteItem: (index: number) => void;
|
||||
}
|
||||
|
||||
const DragHandle = SortableHandle(() => <SelectorIcon className={`w-6 h-6 cursor-move hover:text-[var(--frontmatter-link-hover)]`} />);
|
||||
const DragHandle = SortableHandle(() => <ChevronUpDownIcon className={`w-6 h-6 mr-2 cursor-move hover:text-[var(--frontmatter-link-hover)]`} />);
|
||||
|
||||
export const SortableItem = SortableElement(
|
||||
({
|
||||
@@ -27,7 +26,6 @@ export const SortableItem = SortableElement(
|
||||
onDeleteItem
|
||||
}: ISortableItemProps) => {
|
||||
const [showAlert, setShowAlert] = React.useState(false);
|
||||
const { getColors } = useThemeColors();
|
||||
|
||||
const deleteItemConfirm = () => {
|
||||
setShowAlert(true);
|
||||
@@ -37,12 +35,8 @@ export const SortableItem = SortableElement(
|
||||
<>
|
||||
<li
|
||||
data-test={`${selectedIndex}-${crntIndex}`}
|
||||
className={`sortable_item py-2 px-2 w-full flex justify-between content-center cursor-pointer ${selectedIndex === crntIndex ? getColors(`bg-gray-300 dark:bg-vulcan-300`, `bg-[var(--frontmatter-list-selected-background)] text-[var(--frontmatter-list-selected-text)]`) : ``
|
||||
} ${getColors(
|
||||
'hover:bg-gray-200 dark:hover:bg-vulcan-400',
|
||||
'hover:bg-[var(--frontmatter-list-hover-background)]'
|
||||
)
|
||||
}`}
|
||||
className={`sortable_item py-2 px-2 w-full flex justify-between content-center cursor-pointer ${selectedIndex === crntIndex ? `bg-[var(--frontmatter-list-selected-background)] text-[var(--frontmatter-list-selected-text)]` : ``
|
||||
} hover:bg-[var(--frontmatter-list-hover-background)]`}
|
||||
>
|
||||
<div
|
||||
className="flex items-center w-full"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { ExclamationIcon } from '@heroicons/react/solid';
|
||||
import { ExclamationTriangleIcon } from '@heroicons/react/24/solid';
|
||||
import * as React from 'react';
|
||||
import useThemeColors from '../../hooks/useThemeColors';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
|
||||
@@ -9,11 +8,9 @@ export interface IErrorViewProps { }
|
||||
export const ErrorView: React.FunctionComponent<IErrorViewProps> = (
|
||||
_: React.PropsWithChildren<IErrorViewProps>
|
||||
) => {
|
||||
const { getColors } = useThemeColors();
|
||||
|
||||
return (
|
||||
<main className={`h-full w-full flex flex-col justify-center items-center space-y-2`}>
|
||||
<ExclamationIcon className={`w-24 h-24 ${getColors(`text-red-500`, `text-[var(--vscode-editorError-foreground)]`)}`} />
|
||||
<ExclamationTriangleIcon className={`w-24 h-24 text-[var(--vscode-editorError-foreground)]`} />
|
||||
<p className="text-xl">{l10n.t(LocalizationKey.commonErrorMessage)}</p>
|
||||
<p className="text-base">{l10n.t(LocalizationKey.dashboardErrorViewDescription)}</p>
|
||||
</main>
|
||||
|
||||
66
src/dashboardWebView/components/Filters/LanguageFilter.tsx
Normal file
@@ -0,0 +1,66 @@
|
||||
import * as React from 'react';
|
||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuSeparator } from '../../../components/shadcn/Dropdown';
|
||||
import { LanguageIcon } from '@heroicons/react/24/outline';
|
||||
import { MenuButton, MenuItem } from '../Menu';
|
||||
import { useRecoilState, useRecoilValue } from 'recoil';
|
||||
import { DEFAULT_LOCALE_STATE, LocaleAtom, LocalesAtom } from '../../state';
|
||||
import * as l10n from '@vscode/l10n';
|
||||
import { LocalizationKey } from '../../../localization';
|
||||
|
||||
export interface ILanguageFilterProps { }
|
||||
|
||||
export const LanguageFilter: React.FunctionComponent<ILanguageFilterProps> = ({ }: React.PropsWithChildren<ILanguageFilterProps>) => {
|
||||
const locales = useRecoilValue(LocalesAtom);
|
||||
const [crntLocale, setCrntLocale] = useRecoilState(LocaleAtom);
|
||||
|
||||
const crntLocaleName = React.useMemo(() => {
|
||||
if (!crntLocale || !locales || locales.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const locale = locales.find(locale => locale.locale === crntLocale);
|
||||
|
||||
return locale?.title || locale?.locale;
|
||||
}, [crntLocale, locales]);
|
||||
|
||||
if (!locales || locales.length <= 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<DropdownMenu>
|
||||
<MenuButton
|
||||
label={
|
||||
<>
|
||||
<LanguageIcon className={`inline-block w-4 h-4 mr-2`} />
|
||||
<span>{l10n.t(LocalizationKey.dashboardFiltersLanguageFilterLabel)}</span>
|
||||
</>
|
||||
}
|
||||
title={crntLocaleName || l10n.t(LocalizationKey.dashboardFiltersLanguageFilterAll)}
|
||||
/>
|
||||
|
||||
<DropdownMenuContent align='start'>
|
||||
<MenuItem
|
||||
title={l10n.t(LocalizationKey.dashboardFiltersLanguageFilterAll)}
|
||||
value={null}
|
||||
isCurrent={crntLocale === DEFAULT_LOCALE_STATE}
|
||||
onClick={() => setCrntLocale(DEFAULT_LOCALE_STATE)}
|
||||
/>
|
||||
|
||||
<DropdownMenuSeparator />
|
||||
|
||||
{
|
||||
locales.map((locale) => (
|
||||
<MenuItem
|
||||
key={locale.locale}
|
||||
title={locale.title || locale.locale}
|
||||
value={locale.locale}
|
||||
isCurrent={locale.locale === crntLocale}
|
||||
onClick={(value) => setCrntLocale(value)}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
);
|
||||
};
|
||||