tiptap-essentials 1.2.1 → 2.0.0-beta.3

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/dist/editor.js DELETED
@@ -1,42 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports["default"] = void 0;
8
- var _core = require("@tiptap/core");
9
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
13
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
14
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
17
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
18
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
19
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
20
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
21
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
22
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
23
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
24
- var CustomEditor = /*#__PURE__*/function (_Editor) {
25
- _inherits(CustomEditor, _Editor);
26
- var _super = _createSuper(CustomEditor);
27
- function CustomEditor(args) {
28
- _classCallCheck(this, CustomEditor);
29
- return _super.call(this, _objectSpread({
30
- editorProps: {
31
- transformPastedText: function transformPastedText(text) {
32
- return text.replace(/\xA0/g, ' ');
33
- },
34
- transformPastedHTML: function transformPastedHTML(html) {
35
- return html.replace(/\xA0/g, ' ');
36
- }
37
- }
38
- }, args));
39
- }
40
- return _createClass(CustomEditor);
41
- }(_core.Editor);
42
- exports["default"] = CustomEditor;
@@ -1,36 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Youtube = void 0;
7
- var _core = require("@tiptap/core");
8
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
- var Youtube = _core.Extension.create({
15
- name: 'youtube',
16
- addCommands: function addCommands() {
17
- return {
18
- setYoutubeLink: function setYoutubeLink(attrs) {
19
- return function (_ref) {
20
- var commands = _ref.commands;
21
- var cAttrs = {
22
- src: attrs.src.replace('watch?v=', 'embed/'),
23
- style: 'width: 100%; aspect-ratio: 1200 / 660; border: 0;',
24
- allow: 'autoplay',
25
- allowfullscreen: 'true'
26
- };
27
- return commands.insertContent({
28
- type: 'iframe',
29
- attrs: _objectSpread(_objectSpread({}, attrs), cAttrs)
30
- });
31
- };
32
- }
33
- };
34
- }
35
- });
36
- exports.Youtube = Youtube;
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SpanWrapper = void 0;
7
- var _core = require("@tiptap/core");
8
- var SpanWrapper = _core.Mark.create({
9
- name: 'spanWrapper',
10
- addAttributes: function addAttributes() {
11
- return {
12
- "class": {
13
- "default": null
14
- }
15
- };
16
- },
17
- parseHTML: function parseHTML() {
18
- return [{
19
- tag: 'span'
20
- }];
21
- },
22
- renderHTML: function renderHTML(_ref) {
23
- var HTMLAttributes = _ref.HTMLAttributes;
24
- return ['span', (0, _core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), 0];
25
- }
26
- });
27
- exports.SpanWrapper = SpanWrapper;
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Iframe = void 0;
7
- var _core = require("@tiptap/core");
8
- var Iframe = _core.Node.create({
9
- name: 'iframe',
10
- group: 'inline',
11
- inline: true,
12
- draggable: true,
13
- addOptions: function addOptions() {
14
- return {
15
- HTMLAttributes: {}
16
- };
17
- },
18
- addAttributes: function addAttributes() {
19
- return {
20
- src: {},
21
- title: {
22
- "default": null
23
- },
24
- style: {
25
- "default": null
26
- },
27
- loading: {
28
- "default": 'lazy'
29
- },
30
- allow: {
31
- "default": null
32
- },
33
- allowfullscreen: {
34
- "default": 'false'
35
- }
36
- };
37
- },
38
- parseHTML: function parseHTML() {
39
- return [{
40
- tag: 'iframe[src]'
41
- }];
42
- },
43
- renderHTML: function renderHTML(_ref) {
44
- var HTMLAttributes = _ref.HTMLAttributes;
45
- return ['iframe', (0, _core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes)];
46
- }
47
- });
48
- exports.Iframe = Iframe;
package/index.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require("./dist");