Compare commits

..

No commits in common. "8f74a96f38371d03be0754178b050ced8cfc30b2" and "f6f77107f740a98c36bc685e1a575bbcf4f8fe25" have entirely different histories.

30 changed files with 23672 additions and 13620 deletions

2
.gitignore vendored
View File

@ -1,5 +1,3 @@
/node_modules/ /node_modules/
/po/*.pot
/web/static/editor.css /web/static/editor.css
/web/static/editor.js /web/static/editor.js
/web/static/*.json

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MarkdownSettings">
<enabledExtensions>
<entry key="MermaidLanguageExtension" value="false" />
<entry key="PlantUMLLanguageExtension" value="false" />
</enabledExtensions>
</component>
</project>

View File

@ -5,7 +5,6 @@
<exclude-output /> <exclude-output />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/web" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/web" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/po/src" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />

View File

@ -1,18 +0,0 @@
DEFAULT_DOMAIN = editor
POT_FILE = po/$(DEFAULT_DOMAIN).pot
LINGUAS = es
JSON_FILES = $(patsubst %,web/static/%.json,$(LINGUAS))
locales: $(JSON_FILES)
po/%.po: $(POT_FILE)
msgmerge --no-wrap --update --backup=off $@ $<
web/static/%.json: po/%.po
npx po2json --format jed1.x $< $@
$(POT_FILE):
wp i18n make-pot . $@ --ignore-domain --include=editor,po/src
.PHONY: locales

View File

@ -2,12 +2,6 @@ module.exports = (api) => {
api.cache(true); api.cache(true);
return { return {
plugins: [
[
"@wordpress/babel-plugin-makepot",
{"output": "po/editor.pot"}
],
],
presets: ['@wordpress/babel-preset-default'], presets: ['@wordpress/babel-preset-default'],
}; };
}; };

View File

@ -1,5 +1,4 @@
import {render} from '@wordpress/element'; import {render} from '@wordpress/element';
import {__, setLocaleData} from '@wordpress/i18n';
import './style.scss'; import './style.scss';
import IsolatedBlockEditor, {ToolbarSlot} from '@automattic/isolated-block-editor'; import IsolatedBlockEditor, {ToolbarSlot} from '@automattic/isolated-block-editor';
@ -53,13 +52,7 @@ function save() {
fetch('/edit', requestOptions); fetch('/edit', requestOptions);
} }
async function load(editor) { render(
const response = await fetch('/static/es.json');
const result = await response.json();
const localeData = result.locale_data.messages;
localeData[""].domain = "default";
setLocaleData(localeData, 'default');
render(
<IsolatedBlockEditor <IsolatedBlockEditor
settings={settings} settings={settings}
onLoad={(parser, rawHandler) => onLoad(textarea.value, parser, rawHandler)} onLoad={(parser, rawHandler) => onLoad(textarea.value, parser, rawHandler)}
@ -67,11 +60,8 @@ async function load(editor) {
onError={() => document.location.reload()} onError={() => document.location.reload()}
> >
<ToolbarSlot> <ToolbarSlot>
<Button onClick={save} variant="primary">{__('Beep!')}</Button> <Button onClick={save} variant="primary">Beep!</Button>
</ToolbarSlot> </ToolbarSlot>
</IsolatedBlockEditor>, </IsolatedBlockEditor>,
editor editor
); );
}
load(editor);

23855
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -10,9 +10,7 @@
"@wordpress/block-library": "8.8.0", "@wordpress/block-library": "8.8.0",
"@wordpress/components": "23.8.0", "@wordpress/components": "23.8.0",
"@wordpress/edit-post": "7.8.0", "@wordpress/edit-post": "7.8.0",
"@wordpress/element": "5.8.0", "@wordpress/format-library": "4.8.0"
"@wordpress/format-library": "4.8.0",
"@wordpress/i18n": "4.31.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.21.4", "@babel/core": "^7.21.4",
@ -22,11 +20,11 @@
"@emotion/styled": "^11.10.6", "@emotion/styled": "^11.10.6",
"@shopify/polyfills": "^4.0.3", "@shopify/polyfills": "^4.0.3",
"@wordpress/babel-preset-default": "^7.15.0", "@wordpress/babel-preset-default": "^7.15.0",
"@wordpress/scripts": "^26.2.0",
"babel-loader": "^9.1.2", "babel-loader": "^9.1.2",
"babel-plugin-inline-json-import": "^0.3.2", "babel-plugin-inline-json-import": "^0.3.2",
"css-loader": "^6.7.3", "css-loader": "^6.7.3",
"mini-css-extract-plugin": "^2.7.5", "mini-css-extract-plugin": "^2.7.5",
"po2json": "^0.4.5",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"sass-loader": "^13.2.2", "sass-loader": "^13.2.2",

13326
po/es.po

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/a11y/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/annotations/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/api-fetch/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/block-editor/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/block-library/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/blocks/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/components/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/core-data/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/edit-post/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/editor/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/format-library/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/interface/src

View File

@ -1 +0,0 @@
../../node_modules/@automattic/isolated-block-editor/src/

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/keycodes/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/list-reusable-blocks/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/media-utils/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/preferences/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/reusable-blocks/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/rich-text/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/server-side-render/src

View File

@ -1 +0,0 @@
../../node_modules/@wordpress/widgets/src