ep_font_size 0.4.101 → 0.4.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/automerge.yml +30 -0
- package/.github/workflows/npmpublish.yml +11 -3
- package/README.md +1 -1
- package/demo.gif +0 -0
- package/demo.png +0 -0
- package/exportHTML.js +9 -16
- package/index.js +9 -16
- package/package.json +5 -2
- package/static/js/index.js +8 -27
- package/static/js/shared.js +8 -9
- package/templates/fileMenu.ejs +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Dependabot Automerge
|
|
2
|
+
permissions:
|
|
3
|
+
contents: write
|
|
4
|
+
pull-requests: write
|
|
5
|
+
on:
|
|
6
|
+
workflow_run:
|
|
7
|
+
workflows:
|
|
8
|
+
- Node.js Package
|
|
9
|
+
types:
|
|
10
|
+
- completed
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
automerge:
|
|
14
|
+
if: >
|
|
15
|
+
github.event.workflow_run.conclusion == 'success' &&
|
|
16
|
+
github.event.workflow_run.event == 'push' &&
|
|
17
|
+
github.event.workflow_run.actor.login == 'dependabot[bot]'
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout
|
|
21
|
+
uses: actions/checkout@v6
|
|
22
|
+
|
|
23
|
+
- name: Automerge
|
|
24
|
+
uses: "pascalgn/automerge-action@v0.16.4"
|
|
25
|
+
env:
|
|
26
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
27
|
+
MERGE_METHOD: squash
|
|
28
|
+
MERGE_LABELS: ""
|
|
29
|
+
MERGE_RETRY_SLEEP: "100000"
|
|
30
|
+
|
|
@@ -59,12 +59,20 @@ jobs:
|
|
|
59
59
|
[ "${NEW_COMMITS}" -gt 0 ] || exit 0
|
|
60
60
|
git config user.name 'github-actions[bot]'
|
|
61
61
|
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
|
|
62
|
-
pnpm i
|
|
62
|
+
pnpm i --frozen-lockfile
|
|
63
63
|
# `pnpm version patch` bumps package.json, makes a commit, and creates
|
|
64
64
|
# a `v<new-version>` tag. Capture the new tag name from package.json
|
|
65
65
|
# rather than parsing pnpm's output, which has historically varied.
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
# Bump the patch component directly with Node. pnpm/action-setup@v6
|
|
67
|
+
# sometimes installs pnpm 11 pre-releases even when version: 10.x is
|
|
68
|
+
# requested (pnpm/action-setup#225); those pre-releases either skip
|
|
69
|
+
# the git commit/tag or reject --no-git-tag-version as unknown.
|
|
70
|
+
# Doing the bump in Node sidesteps both failure modes.
|
|
71
|
+
NEW_VERSION=$(node -e "const fs=require('fs');const p=require('./package.json');const v=p.version.split('.');v[2]=String(Number(v[2])+1);p.version=v.join('.');fs.writeFileSync('./package.json',JSON.stringify(p,null,2)+'\n');console.log(p.version);")
|
|
72
|
+
NEW_TAG="v${NEW_VERSION}"
|
|
73
|
+
git add package.json
|
|
74
|
+
git commit -m "${NEW_TAG}"
|
|
75
|
+
git tag -a "${NEW_TAG}" -m "${NEW_TAG}"
|
|
68
76
|
# CRITICAL: use --atomic so the branch update and the tag update
|
|
69
77
|
# succeed (or fail) as a single transaction on the server. The old
|
|
70
78
|
# `git push --follow-tags` was non-atomic per ref: if a concurrent
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
 [](https://github.com/ether/ep_font_size/actions/workflows/test-and-release.yml)
|
|
2
2
|
|
|
3
3
|
[](https://travis-ci.com/github/ether/ep_font_size.git)
|
|
4
4
|
|
package/demo.gif
ADDED
|
Binary file
|
package/demo.png
ADDED
|
Binary file
|
package/exportHTML.js
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const {inlineAttributeExport} = require('ep_plugin_helpers/attributes-server');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
5
|
+
const sizeExport = inlineAttributeExport({
|
|
6
|
+
attr: 'font-size',
|
|
7
|
+
exportCssFile: 'ep_font_size/static/css/size.css',
|
|
8
|
+
exportDataAttr: 'data-font-size',
|
|
9
|
+
});
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
exports.stylesForExport =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
exports.getLineHTMLForExport = async (hookName, context) => {
|
|
17
|
-
// Replace data-size="foo" with class="font-size:x".
|
|
18
|
-
context.lineContent = context.lineContent.replace(
|
|
19
|
-
/data-font-size=["|']([0-9a-zA-Z]+)["|']/gi, 'class="font-size:$1"');
|
|
20
|
-
};
|
|
11
|
+
exports.exportHtmlAdditionalTagsWithData = sizeExport.exportHtmlAdditionalTagsWithData;
|
|
12
|
+
exports.stylesForExport = sizeExport.stylesForExport;
|
|
13
|
+
exports.getLineHTMLForExport = sizeExport.getLineHTMLForExport;
|
package/index.js
CHANGED
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const eejs = require('ep_etherpad-lite/node/eejs/');
|
|
4
3
|
const settingsModule = require('ep_etherpad-lite/node/utils/Settings');
|
|
5
4
|
const settings = settingsModule.default || settingsModule;
|
|
5
|
+
const {template, rawHTML} = require('ep_plugin_helpers');
|
|
6
|
+
const eejs = require('ep_etherpad-lite/node/eejs/');
|
|
6
7
|
const shared = require('./static/js/shared');
|
|
7
8
|
|
|
8
|
-
exports.eejsBlock_editbarMenuLeft = (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
args.content += eejs.require('ep_font_size/templates/editbarButtons.ejs');
|
|
13
|
-
return cb();
|
|
14
|
-
};
|
|
9
|
+
exports.eejsBlock_editbarMenuLeft = template('ep_font_size/templates/editbarButtons.ejs', {
|
|
10
|
+
skip: () => settings.toolbar && JSON.stringify(settings.toolbar).indexOf('fontSize') > -1,
|
|
11
|
+
});
|
|
15
12
|
|
|
16
|
-
exports.eejsBlock_dd_format = (
|
|
17
|
-
args.content += eejs.require('ep_font_size/templates/fileMenu.ejs');
|
|
18
|
-
return cb();
|
|
19
|
-
};
|
|
13
|
+
exports.eejsBlock_dd_format = template('ep_font_size/templates/fileMenu.ejs');
|
|
20
14
|
|
|
21
|
-
exports.eejsBlock_timesliderStyles = (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
15
|
+
exports.eejsBlock_timesliderStyles = rawHTML(
|
|
16
|
+
`<style>${eejs.require('ep_font_size/static/css/size.css')}</style>`
|
|
17
|
+
);
|
|
25
18
|
|
|
26
19
|
exports.padInitToolbar = (hookName, args, cb) => {
|
|
27
20
|
const toolbar = args.toolbar;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"description": "Apply sizes to fonts",
|
|
3
3
|
"name": "ep_font_size",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.103",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "John McLear",
|
|
@@ -27,9 +27,12 @@
|
|
|
27
27
|
"type": "individual",
|
|
28
28
|
"url": "https://etherpad.org/"
|
|
29
29
|
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"ep_plugin_helpers": "^0.2.7"
|
|
32
|
+
},
|
|
30
33
|
"devDependencies": {
|
|
31
34
|
"eslint": "^8.57.1",
|
|
32
|
-
"eslint-config-etherpad": "^4.0.
|
|
35
|
+
"eslint-config-etherpad": "^4.0.5",
|
|
33
36
|
"typescript": "^5.9.3"
|
|
34
37
|
},
|
|
35
38
|
"scripts": {
|
package/static/js/index.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const {inlineAttribute} = require('ep_plugin_helpers/attributes');
|
|
3
4
|
const shared = require('./shared');
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
const fontSize = inlineAttribute({attr: 'font-size'});
|
|
7
|
+
|
|
8
|
+
exports.aceAttribsToClasses = fontSize.aceAttribsToClasses;
|
|
9
|
+
exports.aceCreateDomLine = fontSize.aceCreateDomLine;
|
|
10
|
+
|
|
6
11
|
exports.postAceInit = (hookName, context) => {
|
|
7
12
|
const hs = $('#font-size, select.size-selection');
|
|
8
13
|
hs.on('change', function () {
|
|
@@ -20,36 +25,12 @@ exports.postAceInit = (hookName, context) => {
|
|
|
20
25
|
$('.submenu > .size-selection').attr('size', 6);
|
|
21
26
|
$('.submenu > #font-size').attr('size', 6);
|
|
22
27
|
});
|
|
23
|
-
$('.font-size-icon').click(
|
|
28
|
+
$('.font-size-icon').on('click', () => {
|
|
24
29
|
$('#font-size').toggle();
|
|
25
30
|
});
|
|
26
31
|
};
|
|
27
32
|
|
|
28
|
-
exports.aceAttribsToClasses = (hookName, context) => {
|
|
29
|
-
if (context.key.indexOf('font-size:') !== -1) {
|
|
30
|
-
const size = /(?:^| )font-size:([A-Za-z0-9]*)/.exec(context.key);
|
|
31
|
-
return [`font-size:${size[1]}`];
|
|
32
|
-
}
|
|
33
|
-
if (context.key === 'font-size') {
|
|
34
|
-
return [`font-size:${context.value}`];
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
exports.aceCreateDomLine = (hookName, context) => {
|
|
39
|
-
const cls = context.cls;
|
|
40
|
-
const [, sizesType] = /(?:^| )font-size:([A-Za-z0-9]*)/.exec(cls) || [];
|
|
41
|
-
if (sizesType == null) return [];
|
|
42
|
-
const tagIndex = shared.sizes.indexOf(sizesType);
|
|
43
|
-
if (tagIndex < 0) return [];
|
|
44
|
-
return [{
|
|
45
|
-
extraOpenTags: '',
|
|
46
|
-
extraCloseTags: '',
|
|
47
|
-
cls,
|
|
48
|
-
}];
|
|
49
|
-
};
|
|
50
|
-
|
|
51
33
|
exports.aceInitialized = (hookName, context) => {
|
|
52
|
-
// Passing a level >= 0 will set a sizes on the selected lines, level < 0 will remove it
|
|
53
34
|
context.editorInfo.ace_doInsertsizes = (level) => {
|
|
54
35
|
const {rep, documentAttributeManager} = context;
|
|
55
36
|
if (!(rep.selStart && rep.selEnd)) return;
|
|
@@ -62,7 +43,7 @@ exports.aceInitialized = (hookName, context) => {
|
|
|
62
43
|
exports.aceEditorCSS = () => ['ep_font_size/static/css/size.css'];
|
|
63
44
|
|
|
64
45
|
exports.postToolbarInit = (hookName, context) => {
|
|
65
|
-
context.toolbar.registerCommand('fontSize', (
|
|
46
|
+
context.toolbar.registerCommand('fontSize', () => {
|
|
66
47
|
$('#font-size').toggle();
|
|
67
48
|
});
|
|
68
49
|
};
|
package/static/js/shared.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const range = (b, e, s = 1) => [...Array(Math.ceil((e - b) / s)).keys()].map((x) => (x * s) + b);
|
|
3
|
+
const {inlineAttribute} = require('ep_plugin_helpers/attributes');
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
const size = /(?:^| )font-size:([A-Za-z0-9]*)/.exec(context.cls);
|
|
8
|
-
if (size && size[1]) {
|
|
9
|
-
context.cc.doAttrib(context.state, `font-size:${size[1]}`);
|
|
10
|
-
}
|
|
11
|
-
};
|
|
5
|
+
const range = (b, e, s = 1) => [...Array(Math.ceil((e - b) / s)).keys()].map((x) => (x * s) + b);
|
|
12
6
|
|
|
13
|
-
|
|
7
|
+
const sizes = []
|
|
14
8
|
.concat(range(8, 20))
|
|
15
9
|
.concat(range(20, 30, 2))
|
|
16
10
|
.concat(range(30, 50, 5))
|
|
17
11
|
.concat(range(50, 70, 10));
|
|
12
|
+
|
|
13
|
+
const fontSize = inlineAttribute({attr: 'font-size'});
|
|
14
|
+
|
|
15
|
+
exports.collectContentPre = fontSize.collectContentPre;
|
|
16
|
+
exports.sizes = sizes;
|
package/templates/fileMenu.ejs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<hr>
|
|
2
|
-
<li><a href="#" data-key="
|
|
2
|
+
<li><a href="#" data-key="fontSize" class="font_size" data-l10n-id="ep_font_size.size">Font size</a>
|
|
3
3
|
<ul class="submenu">
|
|
4
4
|
<select id="font-size" class="size-selection">
|
|
5
5
|
<option value="dummy" selected data-l10n-id="ep_font_size.size">Font Size</option>
|