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/
/po/*.pot
/web/static/editor.css
/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 />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/web" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/po/src" />
</content>
<orderEntry type="inheritedJdk" />
<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

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

View File

@ -1,5 +1,4 @@
import {render} from '@wordpress/element';
import {__, setLocaleData} from '@wordpress/i18n';
import './style.scss';
import IsolatedBlockEditor, {ToolbarSlot} from '@automattic/isolated-block-editor';
@ -53,25 +52,16 @@ function save() {
fetch('/edit', requestOptions);
}
async function load(editor) {
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
settings={settings}
onLoad={(parser, rawHandler) => onLoad(textarea.value, parser, rawHandler)}
onSaveContent={(content) => saveBlocks(content, textarea)}
onError={() => document.location.reload()}
>
<ToolbarSlot>
<Button onClick={save} variant="primary">{__('Beep!')}</Button>
</ToolbarSlot>
</IsolatedBlockEditor>,
editor
);
}
load(editor);
render(
<IsolatedBlockEditor
settings={settings}
onLoad={(parser, rawHandler) => onLoad(textarea.value, parser, rawHandler)}
onSaveContent={(content) => saveBlocks(content, textarea)}
onError={() => document.location.reload()}
>
<ToolbarSlot>
<Button onClick={save} variant="primary">Beep!</Button>
</ToolbarSlot>
</IsolatedBlockEditor>,
editor
);

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