mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
chore(ckeditor5-footnotes): clean up
This commit is contained in:
parent
78544e5c99
commit
9de3f0f4ba
@ -1,19 +0,0 @@
|
|||||||
# Configurations to normalize the IDE behavior.
|
|
||||||
# http://editorconfig.org/
|
|
||||||
|
|
||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
indent_style = tab
|
|
||||||
tab_width = 4
|
|
||||||
charset = utf-8
|
|
||||||
end_of_line = lf
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
insert_final_newline = true
|
|
||||||
|
|
||||||
[*.{js,jsx,ts}]
|
|
||||||
quote_type = single
|
|
||||||
|
|
||||||
[package.json]
|
|
||||||
indent_style = space
|
|
||||||
tab_width = 2
|
|
@ -1,46 +0,0 @@
|
|||||||
/* eslint-env node */
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
extends: 'ckeditor5',
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
plugins: [
|
|
||||||
'@typescript-eslint'
|
|
||||||
],
|
|
||||||
root: true,
|
|
||||||
ignorePatterns: [
|
|
||||||
// Ignore the entire `dist/` (the NIM build).
|
|
||||||
'dist/**',
|
|
||||||
// Ignore compiled JavaScript files, as they are generated automatically.
|
|
||||||
'src/**/*.js',
|
|
||||||
// Also, do not check typing declarations, too.
|
|
||||||
'src/**/*.d.ts'
|
|
||||||
],
|
|
||||||
rules: {
|
|
||||||
// This rule disallows importing from any path other than the package main entrypoint.
|
|
||||||
'ckeditor5-rules/allow-imports-only-from-main-package-entry-point': 'error',
|
|
||||||
// This rule ensures that all imports from `@ckeditor/*` packages are done through the main package entry points.
|
|
||||||
// This is required for the editor types to work properly and to ease migration to the installation methods
|
|
||||||
// introduced in CKEditor 5 version 42.0.0.
|
|
||||||
'ckeditor5-rules/no-legacy-imports': 'error',
|
|
||||||
// As required by the ECMAScript (ESM) standard, all imports must include a file extension.
|
|
||||||
// If the import does not include it, this rule will try to automatically detect the correct file extension.
|
|
||||||
'ckeditor5-rules/require-file-extensions-in-imports': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
extensions: [ '.ts', '.js', '.json' ]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: [ 'tests/**/*.[jt]s', 'sample/**/*.[jt]s' ],
|
|
||||||
rules: {
|
|
||||||
// To write complex tests, you may need to import files that are not exported in DLL files by default.
|
|
||||||
// Hence, imports CKEditor 5 packages in test files are not checked.
|
|
||||||
'ckeditor5-rules/ckeditor-imports': 'off'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
19
_regroup/ckeditor5-footnotes/.gitattributes
vendored
19
_regroup/ckeditor5-footnotes/.gitattributes
vendored
@ -1,19 +0,0 @@
|
|||||||
* text=auto
|
|
||||||
|
|
||||||
*.htaccess eol=lf
|
|
||||||
*.cgi eol=lf
|
|
||||||
*.sh eol=lf
|
|
||||||
|
|
||||||
*.css text
|
|
||||||
*.htm text
|
|
||||||
*.html text
|
|
||||||
*.js text
|
|
||||||
*.ts text
|
|
||||||
*.json text
|
|
||||||
*.php text
|
|
||||||
*.txt text
|
|
||||||
*.md text
|
|
||||||
|
|
||||||
*.png -text
|
|
||||||
*.gif -text
|
|
||||||
*.jpg -text
|
|
@ -1,26 +0,0 @@
|
|||||||
name: Release
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
jobs:
|
|
||||||
publish-package:
|
|
||||||
name: Publish package
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up Node
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 22
|
|
||||||
registry-url: 'https://registry.npmjs.org'
|
|
||||||
always-auth: true
|
|
||||||
- run: |
|
|
||||||
corepack enable &&
|
|
||||||
corepack install
|
|
||||||
- name: Install dependencies
|
|
||||||
run: yarn install --frozen-lockfile
|
|
||||||
- name: Publish package
|
|
||||||
run: yarn publish --access public
|
|
||||||
env:
|
|
||||||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
8
_regroup/ckeditor5-footnotes/.gitignore
vendored
8
_regroup/ckeditor5-footnotes/.gitignore
vendored
@ -1,8 +0,0 @@
|
|||||||
build/
|
|
||||||
coverage/
|
|
||||||
dist/
|
|
||||||
node_modules/
|
|
||||||
tmp/
|
|
||||||
sample/ckeditor.dist.js
|
|
||||||
|
|
||||||
# Ignore compiled TypeScript files.
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "stylelint-config-ckeditor5"
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
Software License Agreement
|
|
||||||
==========================
|
|
||||||
|
|
||||||
Copyright (c) 2024. All rights reserved.
|
|
||||||
|
|
||||||
Licensed under the terms of [ISC license](https://opensource.org/licenses/ISC).
|
|
||||||
|
|
||||||
This code is highly derivative of [Forum Magnum Footnote Plugin](https://github.com/ForumMagnum/ForumMagnum/tree/master/public/lesswrong-editor/src/ckeditor5-footnote/src) with original license reproduced below:
|
|
||||||
|
|
||||||
ISC License
|
|
||||||
|
|
||||||
Copyright (c) 2020 Bohan Niu
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
||||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
||||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
||||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
||||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
||||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
||||||
PERFORMANCE OF THIS SOFTWARE.
|
|
@ -1,155 +0,0 @@
|
|||||||
@tomaitken/ckeditor5-footnotes
|
|
||||||
==============================
|
|
||||||
|
|
||||||
This package was created by the [ckeditor5-package-generator](https://www.npmjs.com/package/ckeditor5-package-generator) package. It is essentially lifted from the [ForumMagnum Footnote Plugin](https://github.com/ForumMagnum/ForumMagnum/tree/master/public/lesswrong-editor/src/ckeditor5-footnote/src) with only minor modifications. All intellectual credit should go to the developers of this plugin.
|
|
||||||
|
|
||||||
## Table of contents
|
|
||||||
|
|
||||||
* [Usage](#usage)
|
|
||||||
* [Developing the package](#developing-the-package)
|
|
||||||
* [Available scripts](#available-scripts)
|
|
||||||
* [`start`](#start)
|
|
||||||
* [`test`](#test)
|
|
||||||
* [`lint`](#lint)
|
|
||||||
* [`stylelint`](#stylelint)
|
|
||||||
* [`build:dist`](#builddist)
|
|
||||||
* [`translations:collect`](#translationscollect)
|
|
||||||
* [`translations:download`](#translationsdownload)
|
|
||||||
* [`translations:upload`](#translationsupload)
|
|
||||||
* [`ts:build` and `ts:clear`](#tsbuild-and-tsclear)
|
|
||||||
* [License](#license)
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
Install via NPM / yarn.
|
|
||||||
|
|
||||||
Then import code and CSS:
|
|
||||||
```
|
|
||||||
import '@tomaitken/ckeditor5-footnotes/index.css';
|
|
||||||
|
|
||||||
import { Footnotes } from '@tomaitken/ckeditor5-footnotes';
|
|
||||||
```
|
|
||||||
|
|
||||||
Then add this `Footnotes` import to the plugins list and the string `'footnote'` to the toolbar buttons.
|
|
||||||
|
|
||||||
## Developing the package
|
|
||||||
|
|
||||||
To read about the CKEditor 5 Framework, visit the [CKEditor 5 Framework documentation](https://ckeditor.com/docs/ckeditor5/latest/framework/index.html).
|
|
||||||
|
|
||||||
## Available scripts
|
|
||||||
|
|
||||||
NPM scripts are a convenient way to provide commands in a project. They are defined in the `package.json` file and shared with people contributing to the project. It ensures developers use the same command with the same options (flags).
|
|
||||||
|
|
||||||
All the scripts can be executed by running `yarn run <script>`. Pre and post commands with matching names will be run for those as well.
|
|
||||||
|
|
||||||
The following scripts are available in the package.
|
|
||||||
|
|
||||||
### `start`
|
|
||||||
|
|
||||||
Starts an HTTP server with the live-reload mechanism that allows previewing and testing of plugins available in the package.
|
|
||||||
|
|
||||||
When the server starts, the default browser will open the developer sample. This can be disabled by passing the `--no-open` option to that command.
|
|
||||||
|
|
||||||
You can also define the language that will translate the created editor by specifying the `--language [LANG]` option. It defaults to `'en'`.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Starts the server and open the browser.
|
|
||||||
yarn run start
|
|
||||||
|
|
||||||
# Disable auto-opening the browser.
|
|
||||||
yarn run start --no-open
|
|
||||||
|
|
||||||
# Create the editor with the interface in German.
|
|
||||||
yarn run start --language=de
|
|
||||||
```
|
|
||||||
|
|
||||||
### ~`test`~
|
|
||||||
|
|
||||||
There are no tests for this plugin! Too lazy!
|
|
||||||
|
|
||||||
|
|
||||||
### `lint`
|
|
||||||
|
|
||||||
Runs ESLint, which analyzes the code (all `*.ts` files) to quickly find problems.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Execute eslint.
|
|
||||||
yarn run lint
|
|
||||||
```
|
|
||||||
|
|
||||||
### `stylelint`
|
|
||||||
|
|
||||||
Similar to the `lint` task, stylelint analyzes the CSS code (`*.css` files in the `theme/` directory) in the package.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Execute stylelint.
|
|
||||||
yarn run stylelint
|
|
||||||
```
|
|
||||||
|
|
||||||
### `build:dist`
|
|
||||||
|
|
||||||
Creates npm and browser builds of your plugin. These builds can be added to the editor by following the [Configuring CKEditor 5 features](https://ckeditor.com/docs/ckeditor5/latest/getting-started/setup/configuration.html) guide.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Builds the `npm` and browser files thats are ready to publish.
|
|
||||||
npm run build:dist
|
|
||||||
```
|
|
||||||
|
|
||||||
### `translations:collect`
|
|
||||||
|
|
||||||
Collects translation messages (arguments of the `t()` function) and context files, then validates whether the provided values do not interfere with the values specified in the `@ckeditor/ckeditor5-core` package.
|
|
||||||
|
|
||||||
The task may end with an error if one of the following conditions is met:
|
|
||||||
|
|
||||||
* Found the `Unused context` error – entries specified in the `lang/contexts.json` file are not used in source files. They should be removed.
|
|
||||||
* Found the `Context is duplicated for the id` error – some of the entries are duplicated. Consider removing them from the `lang/contexts.json` file, or rewrite them.
|
|
||||||
* Found the `Context for the message id is missing` error – entries specified in source files are not described in the `lang/contexts.json` file. They should be added.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn run translations:collect
|
|
||||||
```
|
|
||||||
|
|
||||||
### `translations:download`
|
|
||||||
|
|
||||||
Download translations from the Transifex server. Depending on users' activity in the project, it creates translation files used for building the editor.
|
|
||||||
|
|
||||||
The task requires passing the URL to Transifex API. Usually, it matches the following format: `https://www.transifex.com/api/2/project/[PROJECT_SLUG]`.
|
|
||||||
|
|
||||||
To avoid passing the `--transifex` option whenever you call the command, you can store it in `package.json`, next to the `ckeditor5-package-tools translations:download` command.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn run translations:download --transifex [API URL]
|
|
||||||
```
|
|
||||||
|
|
||||||
### `translations:upload`
|
|
||||||
|
|
||||||
Uploads translation messages onto the Transifex server. It allows users to create translations into other languages using the Transifex platform.
|
|
||||||
|
|
||||||
The task requires passing the URL to the Transifex API. Usually, it matches the following format: `https://www.transifex.com/api/2/project/[PROJECT_SLUG]`.
|
|
||||||
|
|
||||||
To avoid passing the `--transifex` option whenever you call the command, you can store it in `package.json`, next to the `ckeditor5-package-tools translations:upload` command.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn run translations:upload --transifex [API URL]
|
|
||||||
```
|
|
||||||
|
|
||||||
### `ts:build` and `ts:clear`
|
|
||||||
|
|
||||||
These scripts compile TypeScript and remove the compiled files. They are used in the aforementioned life cycle scripts, and there is no need to call them manually.
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
The `@tomaitken/ckeditor5-footnotes` package is available under [IST license](https://opensource.org/licenses/IST).
|
|
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"plugins": [
|
|
||||||
{
|
|
||||||
"name": "Footnotes",
|
|
||||||
"className": "Footnotes",
|
|
||||||
"description": "Adds text to the editor.",
|
|
||||||
"path": "src/footnotes.ts",
|
|
||||||
"uiComponents": [
|
|
||||||
{
|
|
||||||
"name": "insertFootnote",
|
|
||||||
"type": "Button",
|
|
||||||
"iconPath": "theme/icons/insert-footnote.svg"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"Footnotes": "Content for a tooltip is displayed when a user hovers the CKEditor 5 icon."
|
|
||||||
}
|
|
@ -1,91 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@triliumnext/ckeditor5-footnotes",
|
|
||||||
"version": "0.0.4-hotfix11",
|
|
||||||
"description": "A plugin for CKEditor 5 to allow footnotes.",
|
|
||||||
"keywords": [
|
|
||||||
"ckeditor",
|
|
||||||
"ckeditor5",
|
|
||||||
"ckeditor 5",
|
|
||||||
"ckeditor5-feature",
|
|
||||||
"ckeditor5-plugin",
|
|
||||||
"ckeditor5-package-generator"
|
|
||||||
],
|
|
||||||
"type": "module",
|
|
||||||
"main": "src/index.ts",
|
|
||||||
"module": "src/index.js",
|
|
||||||
"types": "src/index.d.ts",
|
|
||||||
"license": "ISC",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=18.0.0",
|
|
||||||
"npm": ">=5.7.1"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"lang",
|
|
||||||
"src/**/*.js",
|
|
||||||
"src/**/*.css",
|
|
||||||
"src/**/*.d.ts",
|
|
||||||
"build",
|
|
||||||
"theme",
|
|
||||||
"ckeditor5-metadata.json",
|
|
||||||
"CHANGELOG.md"
|
|
||||||
],
|
|
||||||
"dependencies": {
|
|
||||||
"ckeditor5": "43.2.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@ckeditor/ckeditor5-autoformat": "43.2.0",
|
|
||||||
"@ckeditor/ckeditor5-core": "43.2.0",
|
|
||||||
"@ckeditor/ckeditor5-utils": "43.2.0",
|
|
||||||
"@ckeditor/ckeditor5-dev-build-tools": "42.0.1",
|
|
||||||
"@ckeditor/ckeditor5-inspector": ">=4.1.0",
|
|
||||||
"@ckeditor/ckeditor5-package-tools": "^2.1.0",
|
|
||||||
"@types/chai": "^4.3.1",
|
|
||||||
"@types/mocha": "^9.1.1",
|
|
||||||
"@typescript-eslint/eslint-plugin": "~5.43.0",
|
|
||||||
"@typescript-eslint/parser": "^5.18.0",
|
|
||||||
"eslint": "^7.32.0",
|
|
||||||
"eslint-config-ckeditor5": ">=6.0.0",
|
|
||||||
"http-server": "^14.1.0",
|
|
||||||
"husky": "^4.2.5",
|
|
||||||
"lint-staged": "^10.2.6",
|
|
||||||
"stylelint": "^13.13.1",
|
|
||||||
"stylelint-config-ckeditor5": ">=6.0.0",
|
|
||||||
"ts-node": "^10.9.1",
|
|
||||||
"typescript": "5.0.4"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"ckeditor5": ">=42.0.0 || ^0.0.0-nightly"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"ts:build": "tsc -p ./tsconfig.release.json",
|
|
||||||
"ts:clear": "npx rimraf \"src/**/*.@(js|d.ts)\"",
|
|
||||||
"dll:build": "ckeditor5-package-tools dll:build",
|
|
||||||
"dll:serve": "http-server ./ -o sample/dll.html",
|
|
||||||
"lint": "eslint --quiet --ext .ts src/",
|
|
||||||
"lint:fix": "eslint --quiet --fix --ext .ts src/",
|
|
||||||
"stylelint": "stylelint --quiet --allow-empty-input 'theme/**/*.css'",
|
|
||||||
"test": "ckeditor5-package-tools test",
|
|
||||||
"prepare": "yarn run dll:build",
|
|
||||||
"prepublishOnly": "yarn run ts:build && ckeditor5-package-tools export-package-as-javascript",
|
|
||||||
"postpublish": "yarn run ts:clear && ckeditor5-package-tools export-package-as-typescript",
|
|
||||||
"start": "ckeditor5-package-tools start"
|
|
||||||
},
|
|
||||||
"lint-staged": {
|
|
||||||
"**/*.{js,ts}": [
|
|
||||||
"eslint --quiet"
|
|
||||||
],
|
|
||||||
"**/*.css": [
|
|
||||||
"stylelint --quiet --allow-empty-input"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/ThomasAitken/ckeditor5-footnotes.git"
|
|
||||||
},
|
|
||||||
"author": "Thomas Aitken",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/ThomasAitken/ckeditor5-footnotes/issues"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/ThomasAitken/ckeditor5-footnotes#readme",
|
|
||||||
"packageManager": "yarn@1.22.22"
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
declare global {
|
|
||||||
interface Window {
|
|
||||||
editor: ClassicEditor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
import { ClassicEditor } from 'ckeditor5';
|
|
||||||
import 'ckeditor5/ckeditor5.css';
|
|
80
_regroup/ckeditor5-footnotes/sample/ckeditor.js
vendored
80
_regroup/ckeditor5-footnotes/sample/ckeditor.js
vendored
@ -1,80 +0,0 @@
|
|||||||
import { ClassicEditor, Autoformat, Base64UploadAdapter, BlockQuote, Bold, Code, CodeBlock, Essentials, Heading, Image, ImageCaption, ImageStyle, ImageToolbar, ImageUpload, Indent, Italic, Link, List, MediaEmbed, Paragraph, Table, TableToolbar } from 'ckeditor5';
|
|
||||||
import CKEditorInspector from '@ckeditor/ckeditor5-inspector';
|
|
||||||
import Footnotes from '../src/footnotes.js';
|
|
||||||
import 'ckeditor5/ckeditor5.css';
|
|
||||||
ClassicEditor
|
|
||||||
.create(document.getElementById('editor'), {
|
|
||||||
plugins: [
|
|
||||||
Footnotes,
|
|
||||||
Essentials,
|
|
||||||
Autoformat,
|
|
||||||
BlockQuote,
|
|
||||||
Bold,
|
|
||||||
Heading,
|
|
||||||
Image,
|
|
||||||
ImageCaption,
|
|
||||||
ImageStyle,
|
|
||||||
ImageToolbar,
|
|
||||||
ImageUpload,
|
|
||||||
Indent,
|
|
||||||
Italic,
|
|
||||||
Link,
|
|
||||||
List,
|
|
||||||
MediaEmbed,
|
|
||||||
Paragraph,
|
|
||||||
Table,
|
|
||||||
TableToolbar,
|
|
||||||
CodeBlock,
|
|
||||||
Code,
|
|
||||||
Base64UploadAdapter
|
|
||||||
],
|
|
||||||
toolbar: [
|
|
||||||
'undo',
|
|
||||||
'redo',
|
|
||||||
'|',
|
|
||||||
'footnote',
|
|
||||||
'|',
|
|
||||||
'heading',
|
|
||||||
'|',
|
|
||||||
'bold',
|
|
||||||
'italic',
|
|
||||||
'link',
|
|
||||||
'code',
|
|
||||||
'bulletedList',
|
|
||||||
'numberedList',
|
|
||||||
'|',
|
|
||||||
'outdent',
|
|
||||||
'indent',
|
|
||||||
'|',
|
|
||||||
'uploadImage',
|
|
||||||
'blockQuote',
|
|
||||||
'insertTable',
|
|
||||||
'mediaEmbed',
|
|
||||||
'codeBlock'
|
|
||||||
],
|
|
||||||
image: {
|
|
||||||
toolbar: [
|
|
||||||
'imageStyle:inline',
|
|
||||||
'imageStyle:block',
|
|
||||||
'imageStyle:side',
|
|
||||||
'|',
|
|
||||||
'imageTextAlternative'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
table: {
|
|
||||||
contentToolbar: [
|
|
||||||
'tableColumn',
|
|
||||||
'tableRow',
|
|
||||||
'mergeTableCells'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(editor => {
|
|
||||||
window.editor = editor;
|
|
||||||
CKEditorInspector.attach(editor);
|
|
||||||
window.console.log('CKEditor 5 is ready.', editor);
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
window.console.error(err.stack);
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=ckeditor.js.map
|
|
@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"ckeditor.js","sourceRoot":"","sources":["ckeditor.ts"],"names":[],"mappings":"AAMA,OAAO,EACN,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,UAAU,EACV,OAAO,EACP,KAAK,EACL,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,WAAW,EACX,MAAM,EACN,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,SAAS,EACT,KAAK,EACL,YAAY,EACZ,MAAM,WAAW,CAAC;AAEnB,OAAO,iBAAiB,MAAM,+BAA+B,CAAC;AAE9D,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAE5C,OAAO,yBAAyB,CAAC;AAEjC,aAAa;KACX,MAAM,CAAE,QAAQ,CAAC,cAAc,CAAE,QAAQ,CAAG,EAAE;IAC9C,OAAO,EAAE;QACR,SAAS;QACT,UAAU;QACV,UAAU;QACV,UAAU;QACV,IAAI;QACJ,OAAO;QACP,KAAK;QACL,YAAY;QACZ,UAAU;QACV,YAAY;QACZ,WAAW;QACX,MAAM;QACN,MAAM;QACN,IAAI;QACJ,IAAI;QACJ,UAAU;QACV,SAAS;QACT,KAAK;QACL,YAAY;QACZ,SAAS;QACT,IAAI;QACJ,mBAAmB;KACnB;IACD,OAAO,EAAE;QACR,MAAM;QACN,MAAM;QACN,GAAG;QACH,UAAU;QACV,GAAG;QACH,SAAS;QACT,GAAG;QACH,MAAM;QACN,QAAQ;QACR,MAAM;QACN,MAAM;QACN,cAAc;QACd,cAAc;QACd,GAAG;QACH,SAAS;QACT,QAAQ;QACR,GAAG;QACH,aAAa;QACb,YAAY;QACZ,aAAa;QACb,YAAY;QACZ,WAAW;KACX;IACD,KAAK,EAAE;QACN,OAAO,EAAE;YACR,mBAAmB;YACnB,kBAAkB;YAClB,iBAAiB;YACjB,GAAG;YACH,sBAAsB;SACtB;KACD;IACD,KAAK,EAAE;QACN,cAAc,EAAE;YACf,aAAa;YACb,UAAU;YACV,iBAAiB;SACjB;KACD;CACD,CAAE;KACF,IAAI,CAAE,MAAM,CAAC,EAAE;IACf,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,iBAAiB,CAAC,MAAM,CAAE,MAAM,CAAE,CAAC;IACnC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAE,sBAAsB,EAAE,MAAM,CAAE,CAAC;AACtD,CAAC,CAAE;KACF,KAAK,CAAE,GAAG,CAAC,EAAE;IACb,MAAM,CAAC,OAAO,CAAC,KAAK,CAAE,GAAG,CAAC,KAAK,CAAE,CAAC;AACnC,CAAC,CAAE,CAAC"}
|
|
@ -1,112 +0,0 @@
|
|||||||
declare global {
|
|
||||||
interface Window {
|
|
||||||
editor: ClassicEditor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
import {
|
|
||||||
ClassicEditor,
|
|
||||||
Autoformat,
|
|
||||||
Base64UploadAdapter,
|
|
||||||
BlockQuote,
|
|
||||||
Bold,
|
|
||||||
Code,
|
|
||||||
CodeBlock,
|
|
||||||
Essentials,
|
|
||||||
Heading,
|
|
||||||
Image,
|
|
||||||
ImageCaption,
|
|
||||||
ImageStyle,
|
|
||||||
ImageToolbar,
|
|
||||||
ImageUpload,
|
|
||||||
Indent,
|
|
||||||
Italic,
|
|
||||||
Link,
|
|
||||||
List,
|
|
||||||
MediaEmbed,
|
|
||||||
Paragraph,
|
|
||||||
Table,
|
|
||||||
TableToolbar
|
|
||||||
} from 'ckeditor5';
|
|
||||||
|
|
||||||
import CKEditorInspector from '@ckeditor/ckeditor5-inspector';
|
|
||||||
|
|
||||||
import Footnotes from '../src/footnotes.js';
|
|
||||||
|
|
||||||
import 'ckeditor5/ckeditor5.css';
|
|
||||||
|
|
||||||
ClassicEditor
|
|
||||||
.create( document.getElementById( 'editor' )!, {
|
|
||||||
plugins: [
|
|
||||||
Footnotes,
|
|
||||||
Essentials,
|
|
||||||
Autoformat,
|
|
||||||
BlockQuote,
|
|
||||||
Bold,
|
|
||||||
Heading,
|
|
||||||
Image,
|
|
||||||
ImageCaption,
|
|
||||||
ImageStyle,
|
|
||||||
ImageToolbar,
|
|
||||||
ImageUpload,
|
|
||||||
Indent,
|
|
||||||
Italic,
|
|
||||||
Link,
|
|
||||||
List,
|
|
||||||
MediaEmbed,
|
|
||||||
Paragraph,
|
|
||||||
Table,
|
|
||||||
TableToolbar,
|
|
||||||
CodeBlock,
|
|
||||||
Code,
|
|
||||||
Base64UploadAdapter
|
|
||||||
],
|
|
||||||
toolbar: [
|
|
||||||
'undo',
|
|
||||||
'redo',
|
|
||||||
'|',
|
|
||||||
'footnote',
|
|
||||||
'|',
|
|
||||||
'heading',
|
|
||||||
'|',
|
|
||||||
'bold',
|
|
||||||
'italic',
|
|
||||||
'link',
|
|
||||||
'code',
|
|
||||||
'bulletedList',
|
|
||||||
'numberedList',
|
|
||||||
'|',
|
|
||||||
'outdent',
|
|
||||||
'indent',
|
|
||||||
'|',
|
|
||||||
'uploadImage',
|
|
||||||
'blockQuote',
|
|
||||||
'insertTable',
|
|
||||||
'mediaEmbed',
|
|
||||||
'codeBlock'
|
|
||||||
],
|
|
||||||
image: {
|
|
||||||
toolbar: [
|
|
||||||
'imageStyle:inline',
|
|
||||||
'imageStyle:block',
|
|
||||||
'imageStyle:side',
|
|
||||||
'|',
|
|
||||||
'imageTextAlternative'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
table: {
|
|
||||||
contentToolbar: [
|
|
||||||
'tableColumn',
|
|
||||||
'tableRow',
|
|
||||||
'mergeTableCells'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
} )
|
|
||||||
.then( editor => {
|
|
||||||
window.editor = editor;
|
|
||||||
CKEditorInspector.attach( editor );
|
|
||||||
window.console.log( 'CKEditor 5 is ready.', editor );
|
|
||||||
} )
|
|
||||||
.catch( err => {
|
|
||||||
window.console.error( err.stack );
|
|
||||||
} );
|
|
@ -1,172 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<link rel="icon" type="image/png" href="https://ckeditor.com/docs/ckeditor5/latest/assets/img/favicons/32x32.png" sizes="32x32">
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>CKEditor 5 – DLL Sample</title>
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
max-width: 800px;
|
|
||||||
margin: 20px auto;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<h1>CKEditor 5 – DLL Sample</h1>
|
|
||||||
|
|
||||||
<div id="editor">
|
|
||||||
<h2>Production sample</h2>
|
|
||||||
<p>
|
|
||||||
This is a demo of the <a href="https://ckeditor.com/docs/ckeditor5/latest/builds/guides/overview.html#classic-editor">classic editor
|
|
||||||
build</a>, initialized using the <a href="https://ckeditor.com/docs/ckeditor5/latest/builds/guides/development/dll-builds.html">DLL builds</a>.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Your plugin (Footnotes) generated by the tool is already loaded into the editor. By default, it has an example button that adds some text to the editor. Whenever you change the plugin's name or toolbar items, make sure to update the editor configuration in the <code>sample/dll.html</code> file.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h3>Uncaught TypeError</h3>
|
|
||||||
<p>If the editor is not initialized correctly and the browser console displays an error such as the following:</p>
|
|
||||||
<pre><code>Uncaught TypeError: Cannot read properties of undefined (reading 'Footnotes') at dll.html:85</code></pre>
|
|
||||||
<p>it means that the DLL build of the <code>@tomaitken/ckeditor5-footnotes</code> package has not been created.</p>
|
|
||||||
<p>Please call the <code>yarn run dll:build</code> command in the CLI, and after it finishes, refresh the page.</p>
|
|
||||||
|
|
||||||
<h3>Anatomy of the DLL build</h3>
|
|
||||||
<p>The source of the DLL build is located in the <code>src/index.ts</code> file. It may export as many things as the package offers.</p>
|
|
||||||
|
|
||||||
<h4>Maintaining the sample</h4>
|
|
||||||
<p>Whenever you change objects exported by the DLL build, please review the content of the sample. Things to keep in mind:</p>
|
|
||||||
<ul>
|
|
||||||
<li>Review the list of loaded plugins in the configuration.</li>
|
|
||||||
<li>Review names of items registered in toolbars.</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h3>The goal</h3>
|
|
||||||
<p>The primary purpose of the sample is to verify whether the plugins in the package will work together with CKEditor 5 created with the DLL approach.</p>
|
|
||||||
|
|
||||||
<h3>Publishing the package</h3>
|
|
||||||
<p>
|
|
||||||
While releasing TypeScript package on npm, few things have to be taken care of:
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li>Building DLL</li>
|
|
||||||
<li>Building TypeScript</li>
|
|
||||||
<li>Changing the <code>main</code> filed in <code>package.json</code> to <code>.js</code> extension</li>
|
|
||||||
</ul>
|
|
||||||
<p>
|
|
||||||
Likewise, after the release, there are few steps:
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li>Deleting compiled TypeScript files (they are generated in the <code>src</code> directory, and create needless clutter)</li>
|
|
||||||
<li>Changing the <code>main</code> filed in <code>package.json</code> back to <code>.ts</code> extension</li>
|
|
||||||
</ul>
|
|
||||||
<p>
|
|
||||||
When calling <code>npm publish</code>, those steps are handled automatically by predefined <code>prepublishOnly</code> and <code>postpublish</code> scripts. To learn more, see <a href="https://docs.npmjs.com/cli/v7/using-npm/scripts#pre--post-scripts">NPM docs</a>.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h3>Reporting issues</h3>
|
|
||||||
<p>If you found a problem with CKEditor 5 or the package generator, please, report an issue:</p>
|
|
||||||
<ul>
|
|
||||||
<li><a href="https://github.com/ckeditor/ckeditor5/issues/new/choose">CKEditor 5</a></li>
|
|
||||||
<li><a href="https://github.com/ckeditor/create-ckeditor5-plugin/issues/new">The package generator</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- DLL builds are served from the `node_modules/` directory -->
|
|
||||||
<script src="../node_modules/ckeditor5/build/ckeditor5-dll.js"></script>
|
|
||||||
<script src="../node_modules/@ckeditor/ckeditor5-editor-classic/build/editor-classic.js"></script>
|
|
||||||
<script src="../node_modules/@ckeditor/ckeditor5-code-block/build/code-block.js"></script>
|
|
||||||
<script src="../node_modules/@ckeditor/ckeditor5-essentials/build/essentials.js"></script>
|
|
||||||
<script src="../node_modules/@ckeditor/ckeditor5-basic-styles/build/basic-styles.js"></script>
|
|
||||||
<script src="../node_modules/@ckeditor/ckeditor5-heading/build/heading.js"></script>
|
|
||||||
<script src="../node_modules/@ckeditor/ckeditor5-autoformat/build/autoformat.js"></script>
|
|
||||||
<script src="../node_modules/@ckeditor/ckeditor5-block-quote/build/block-quote.js"></script>
|
|
||||||
<script src="../node_modules/@ckeditor/ckeditor5-image/build/image.js"></script>
|
|
||||||
<script src="../node_modules/@ckeditor/ckeditor5-link/build/link.js"></script>
|
|
||||||
<script src="../node_modules/@ckeditor/ckeditor5-indent/build/indent.js"></script>
|
|
||||||
<script src="../node_modules/@ckeditor/ckeditor5-media-embed/build/media-embed.js"></script>
|
|
||||||
<script src="../node_modules/@ckeditor/ckeditor5-list/build/list.js"></script>
|
|
||||||
<script src="../node_modules/@ckeditor/ckeditor5-table/build/table.js"></script>
|
|
||||||
|
|
||||||
<!-- The "@tomaitken/ckeditor5-footnotes" package DLL build is served from the `build/` directory -->
|
|
||||||
<script src="../build/footnotes.js"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
console.log( 'Objects exported by the DLL build:', CKEditor5[ 'footnotes' ] );
|
|
||||||
|
|
||||||
CKEditor5.editorClassic.ClassicEditor
|
|
||||||
.create( document.querySelector( '#editor' ), {
|
|
||||||
plugins: [
|
|
||||||
CKEditor5[ 'footnotes' ].Footnotes,
|
|
||||||
CKEditor5.essentials.Essentials,
|
|
||||||
CKEditor5.autoformat.Autoformat,
|
|
||||||
CKEditor5.blockQuote.BlockQuote,
|
|
||||||
CKEditor5.basicStyles.Bold,
|
|
||||||
CKEditor5.heading.Heading,
|
|
||||||
CKEditor5.image.Image,
|
|
||||||
CKEditor5.image.ImageCaption,
|
|
||||||
CKEditor5.image.ImageStyle,
|
|
||||||
CKEditor5.image.ImageToolbar,
|
|
||||||
CKEditor5.image.ImageUpload,
|
|
||||||
CKEditor5.indent.Indent,
|
|
||||||
CKEditor5.basicStyles.Italic,
|
|
||||||
CKEditor5.link.Link,
|
|
||||||
CKEditor5.list.List,
|
|
||||||
CKEditor5.mediaEmbed.MediaEmbed,
|
|
||||||
CKEditor5.paragraph.Paragraph,
|
|
||||||
CKEditor5.table.Table,
|
|
||||||
CKEditor5.table.TableToolbar,
|
|
||||||
CKEditor5.codeBlock.CodeBlock,
|
|
||||||
CKEditor5.basicStyles.Code,
|
|
||||||
CKEditor5.upload.Base64UploadAdapter
|
|
||||||
],
|
|
||||||
toolbar: [
|
|
||||||
'footnotesButton',
|
|
||||||
'|',
|
|
||||||
'heading',
|
|
||||||
'|',
|
|
||||||
'bold',
|
|
||||||
'italic',
|
|
||||||
'link',
|
|
||||||
'code',
|
|
||||||
'bulletedList',
|
|
||||||
'numberedList',
|
|
||||||
'|',
|
|
||||||
'outdent',
|
|
||||||
'indent',
|
|
||||||
'|',
|
|
||||||
'uploadImage',
|
|
||||||
'blockQuote',
|
|
||||||
'insertTable',
|
|
||||||
'mediaEmbed',
|
|
||||||
'codeBlock',
|
|
||||||
'|',
|
|
||||||
'undo',
|
|
||||||
'redo'
|
|
||||||
],
|
|
||||||
image: {
|
|
||||||
toolbar: [
|
|
||||||
'imageStyle:inline',
|
|
||||||
'imageStyle:block',
|
|
||||||
'imageStyle:side',
|
|
||||||
'|',
|
|
||||||
'imageTextAlternative'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
table: {
|
|
||||||
contentToolbar: [
|
|
||||||
'tableColumn',
|
|
||||||
'tableRow',
|
|
||||||
'mergeTableCells'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
} )
|
|
||||||
.then( editor => {
|
|
||||||
window.editor = editor;
|
|
||||||
} )
|
|
||||||
.catch( error => {
|
|
||||||
console.error( 'There was a problem initializing the editor.', error );
|
|
||||||
} );
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,123 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<link rel="icon" type="image/png" href="https://ckeditor.com/docs/ckeditor5/latest/assets/img/favicons/32x32.png"
|
|
||||||
sizes="32x32">
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>CKEditor 5 – Development Sample</title>
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
max-width: 800px;
|
|
||||||
margin: 20px auto;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<h1>CKEditor 5 – Development Sample</h1>
|
|
||||||
|
|
||||||
<div id="editor">
|
|
||||||
<h2>Development environment</h2>
|
|
||||||
<p>
|
|
||||||
This is a demo of the <a
|
|
||||||
href="https://ckeditor.com/docs/ckeditor5/latest/builds/guides/overview.html#classic-editor">classic
|
|
||||||
editor
|
|
||||||
build</a> that loads your plugin (<code>Footnotes</code>) generated by the
|
|
||||||
tool. You can modify this
|
|
||||||
sample and use it to validate whether a plugin or a set of plugins work fine.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<code>Footnotes</code> inserts text into the editor. You can click the
|
|
||||||
CKEditor 5 icon in the toolbar and see the results.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h3>Helpful resources</h3>
|
|
||||||
<ul>
|
|
||||||
<li>Architecture
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<a
|
|
||||||
href="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/architecture/core-editor-architecture.html">Core
|
|
||||||
editor architecture</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<a
|
|
||||||
href="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/architecture/editing-engine.html">The
|
|
||||||
editing engine</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<a
|
|
||||||
href="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/architecture/ui-library.html">The
|
|
||||||
UI library</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<a
|
|
||||||
href="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/browser-compatibility.html">Browser
|
|
||||||
compatibility</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<a href="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html">The error
|
|
||||||
codes</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li><a href="https://ckeditor.com/docs/ckeditor5/latest/builds/guides/development/dll-builds.html">The DLL
|
|
||||||
builds</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h3>The directory structure</h3>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
The code snippet below presents the directory structure.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<pre><code class="language-plaintext">.
|
|
||||||
├─ lang
|
|
||||||
│ └─ contexts.json # Entries used for creating translations.
|
|
||||||
├─ sample
|
|
||||||
│ ├─ dll.html # The editor initialized using the DLL builds. Check README for details.
|
|
||||||
│ ├─ index.html # The currently displayed file.
|
|
||||||
│ └─ ckeditor.ts # The editor initialization script.
|
|
||||||
├─ src
|
|
||||||
│ ├─ footnotes.ts
|
|
||||||
│ ├─ augmentation.ts # Type augmentations for the `@ckeditor/ckeditor5-core` module. Read more in <a href="https://ckeditor.com/docs/ckeditor5/latest/api/module_core_plugincollection-PluginsMap.html">PluginsMap</a> and <a href="https://ckeditor.com/docs/ckeditor5/latest/api/module_core_commandcollection-CommandsMap.html">CommandsMap</a>.
|
|
||||||
│ ├─ index.ts # The modules exported by the package when using the DLL builds.
|
|
||||||
│ └─ **/*.ts # All TypeScript source files should be saved here.
|
|
||||||
├─ tests
|
|
||||||
│ ├─ footnotes.ts
|
|
||||||
│ ├─ index.ts # Tests for the plugin.
|
|
||||||
│ └─ **/*.ts # All tests should be saved here.
|
|
||||||
├─ theme
|
|
||||||
│ ├─ icons
|
|
||||||
│ │ ├─ ckeditor.svg # The CKEditor 5 icon displayed in the toolbar.
|
|
||||||
│ │ └─ **/*.svg # All icon files should be saved here.
|
|
||||||
│ └─ **/*.css # All CSS files should be saved here.
|
|
||||||
├─ typings
|
|
||||||
│ └─ **/*.d.ts # Files containing type definitions.
|
|
||||||
├─ .editorconfig
|
|
||||||
├─ ...
|
|
||||||
├─ README.md
|
|
||||||
└─ tsconfig.json # TypeScript configuration file.</code></pre>
|
|
||||||
|
|
||||||
<h3>Reporting issues</h3>
|
|
||||||
<p>If you found a problem with CKEditor 5 or the package generator, please, report an issue:</p>
|
|
||||||
<ul>
|
|
||||||
<li><a href="https://github.com/ckeditor/ckeditor5/issues/new/choose">CKEditor 5</a></li>
|
|
||||||
<li><a href="https://github.com/ckeditor/ckeditor5-package-generator/issues/new">The package generator</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="./ckeditor.dist.js"></script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
@ -1,65 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @license Copyright (c) 2020-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
||||||
* For licensing, see LICENSE.md.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* eslint-env node */
|
|
||||||
|
|
||||||
import { createRequire } from 'module';
|
|
||||||
import upath from 'upath';
|
|
||||||
import chalk from 'chalk';
|
|
||||||
import { build } from '@ckeditor/ckeditor5-dev-build-tools';
|
|
||||||
|
|
||||||
function dist( path ) {
|
|
||||||
return upath.join( 'dist', path );
|
|
||||||
}
|
|
||||||
|
|
||||||
( async () => {
|
|
||||||
const tsconfig = 'tsconfig.dist.ckeditor5.json';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Step 1
|
|
||||||
*/
|
|
||||||
console.log( chalk.cyan( '1/2: Generating NPM build...' ) );
|
|
||||||
|
|
||||||
const require = createRequire( import.meta.url );
|
|
||||||
const pkg = require( upath.resolve( process.cwd(), './package.json' ) );
|
|
||||||
|
|
||||||
await build( {
|
|
||||||
input: 'src/index.ts',
|
|
||||||
output: dist( './index.js' ),
|
|
||||||
tsconfig: 'tsconfig.dist.json',
|
|
||||||
external: [
|
|
||||||
'ckeditor5',
|
|
||||||
'ckeditor5-premium-features',
|
|
||||||
...Object.keys( {
|
|
||||||
...pkg.dependencies,
|
|
||||||
...pkg.peerDependencies
|
|
||||||
} )
|
|
||||||
],
|
|
||||||
clean: true,
|
|
||||||
sourceMap: true,
|
|
||||||
declarations: true,
|
|
||||||
translations: '**/*.po'
|
|
||||||
} );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Step 2
|
|
||||||
*/
|
|
||||||
console.log( chalk.cyan( '2/2: Generating browser build...' ) );
|
|
||||||
|
|
||||||
await build( {
|
|
||||||
output: dist( 'browser/index.js' ),
|
|
||||||
tsconfig,
|
|
||||||
sourceMap: true,
|
|
||||||
minify: true,
|
|
||||||
browser: true,
|
|
||||||
name: 'footnotes',
|
|
||||||
external: [
|
|
||||||
'ckeditor5',
|
|
||||||
'ckeditor5-premium-features'
|
|
||||||
]
|
|
||||||
} );
|
|
||||||
} )();
|
|
@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"module": "ESNext",
|
|
||||||
"moduleResolution": "bundler",
|
|
||||||
"rootDir": "./src",
|
|
||||||
"types": [
|
|
||||||
"./typings/types"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
/**
|
|
||||||
* TypeScript automagically loads typings from all "@types/*" packages if the "compilerOptions.types" array is not defined in
|
|
||||||
* this file. However, if some dependencies have "@types/*" packages as their dependencies, they'll also be loaded as well.
|
|
||||||
* As a result, TypeScript loaded "@types/node" which we don't want to use, because it allows using Node.js specific APIs that
|
|
||||||
* are not available in the browsers.
|
|
||||||
*
|
|
||||||
* To avoid such issues, we defined this empty "types" to disable automatic inclusion of the "@types/*" packages.
|
|
||||||
*/
|
|
||||||
"types": [],
|
|
||||||
"lib": [
|
|
||||||
"ES2019", // Must match the "target".
|
|
||||||
"ES2020.String",
|
|
||||||
"DOM",
|
|
||||||
"DOM.Iterable"
|
|
||||||
],
|
|
||||||
"noImplicitAny": true,
|
|
||||||
"noImplicitOverride": true,
|
|
||||||
"strict": true,
|
|
||||||
"target": "es2019",
|
|
||||||
"sourceMap": true,
|
|
||||||
"allowJs": true,
|
|
||||||
"moduleDetection": "force",
|
|
||||||
"moduleResolution": "NodeNext",
|
|
||||||
"module": "NodeNext",
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"typeRoots": [
|
|
||||||
"typings",
|
|
||||||
"node_modules/@types"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"./sample",
|
|
||||||
"./src",
|
|
||||||
"./typings"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"sourceMap": false,
|
|
||||||
"declaration": true
|
|
||||||
},
|
|
||||||
"exclude": [
|
|
||||||
"./tests/",
|
|
||||||
"./src",
|
|
||||||
"./sample/"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"types": [
|
|
||||||
"@types/mocha"
|
|
||||||
],
|
|
||||||
"sourceMap": true
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"./sample",
|
|
||||||
"./src",
|
|
||||||
"./tests",
|
|
||||||
"./typings"
|
|
||||||
]
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,24 @@
|
|||||||
Software License Agreement
|
Software License Agreement
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
Copyright (c) 2025. All rights reserved.
|
Copyright (c) 2024. All rights reserved.
|
||||||
|
|
||||||
Licensed under the terms of [MIT license](https://opensource.org/licenses/MIT).
|
Licensed under the terms of [ISC license](https://opensource.org/licenses/ISC).
|
||||||
|
|
||||||
|
This code is highly derivative of [Forum Magnum Footnote Plugin](https://github.com/ForumMagnum/ForumMagnum/tree/master/public/lesswrong-editor/src/ckeditor5-footnote/src) with original license reproduced below:
|
||||||
|
|
||||||
|
ISC License
|
||||||
|
|
||||||
|
Copyright (c) 2020 Bohan Niu
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||||
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||||
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||||
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||||
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||||
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
PERFORMANCE OF THIS SOFTWARE.
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@triliumnext/ckeditor5-footnotes",
|
"name": "@triliumnext/ckeditor5-footnotes",
|
||||||
"version": "0.0.1",
|
"version": "0.0.4",
|
||||||
"description": "A plugin for CKEditor 5.",
|
"description": "A plugin for CKEditor 5 to allow footnotes.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ckeditor",
|
"ckeditor",
|
||||||
"ckeditor5",
|
"ckeditor5",
|
||||||
@ -23,7 +23,7 @@
|
|||||||
"./browser/*": null,
|
"./browser/*": null,
|
||||||
"./package.json": "./package.json"
|
"./package.json": "./package.json"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "ISC",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0",
|
"node": ">=18.0.0",
|
||||||
"npm": ">=5.7.1"
|
"npm": ">=5.7.1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user