kritzel-stencil 0.1.77 → 0.1.78
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/cjs/{index-Dc7LOVhs.js → index-BRZ6e6oa.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/kritzel-active-users_42.cjs.entry.js +63 -43
- package/dist/cjs/kritzel-brush-style.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stencil.cjs.js +2 -2
- package/dist/cjs/{workspace.migrations-OULs44dI.js → workspace.migrations-sUPrO23c.js} +47 -11
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +14 -10
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.css +21 -0
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +8 -4
- package/dist/collection/components/ui/kritzel-login-dialog/kritzel-login-dialog.css +3 -0
- package/dist/collection/configs/default-engine-config.js +1 -0
- package/dist/collection/constants/version.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/kritzel-active-users.js +1 -1
- package/dist/components/kritzel-avatar.js +1 -1
- package/dist/components/kritzel-awareness-cursors.js +1 -1
- package/dist/components/kritzel-back-to-content.js +1 -1
- package/dist/components/kritzel-brush-style.js +1 -1
- package/dist/components/kritzel-button.js +1 -1
- package/dist/components/kritzel-color-palette.js +1 -1
- package/dist/components/kritzel-color.js +1 -1
- package/dist/components/kritzel-context-menu.js +1 -1
- package/dist/components/kritzel-controls.js +1 -1
- package/dist/components/kritzel-current-user-dialog.js +1 -1
- package/dist/components/kritzel-current-user.js +1 -1
- package/dist/components/kritzel-cursor-trail.js +1 -1
- package/dist/components/kritzel-dialog.js +1 -1
- package/dist/components/kritzel-dropdown.js +1 -1
- package/dist/components/kritzel-editor.js +1 -1
- package/dist/components/kritzel-engine.js +1 -1
- package/dist/components/kritzel-export.js +1 -1
- package/dist/components/kritzel-font-family.js +1 -1
- package/dist/components/kritzel-font-size.js +1 -1
- package/dist/components/kritzel-font.js +1 -1
- package/dist/components/kritzel-icon.js +1 -1
- package/dist/components/kritzel-input.js +1 -1
- package/dist/components/kritzel-line-endings.js +1 -1
- package/dist/components/kritzel-login-dialog.js +1 -1
- package/dist/components/kritzel-master-detail.js +1 -1
- package/dist/components/kritzel-menu-item.js +1 -1
- package/dist/components/kritzel-menu.js +1 -1
- package/dist/components/kritzel-more-menu.js +1 -1
- package/dist/components/kritzel-numeric-input.js +1 -1
- package/dist/components/kritzel-opacity-slider.js +1 -1
- package/dist/components/kritzel-pill-tabs.js +1 -1
- package/dist/components/kritzel-portal.js +1 -1
- package/dist/components/kritzel-settings.js +1 -1
- package/dist/components/kritzel-shape-fill.js +1 -1
- package/dist/components/kritzel-share-dialog.js +1 -1
- package/dist/components/kritzel-slide-toggle.js +1 -1
- package/dist/components/kritzel-split-button.js +1 -1
- package/dist/components/kritzel-stroke-size.js +1 -1
- package/dist/components/kritzel-tool-config.js +1 -1
- package/dist/components/kritzel-tooltip.js +1 -1
- package/dist/components/kritzel-utility-panel.js +1 -1
- package/dist/components/kritzel-workspace-manager.js +1 -1
- package/dist/components/{p-Dt-J69xt.js → p-53di1Zko.js} +1 -1
- package/dist/components/{p-DS0xx1eT.js → p-6NFl6EB2.js} +1 -1
- package/dist/components/{p-DSzQ6H2j.js → p-76W5pG2O.js} +1 -1
- package/dist/components/{p-DRbG92F9.js → p-BLsH_Oi0.js} +1 -1
- package/dist/components/p-Ban3OlgZ.js +9 -0
- package/dist/components/{p-CUkKKbnu.js → p-BrZ_gL8Q.js} +1 -1
- package/dist/components/{p-kj9wbLY8.js → p-BuI6Gkzg.js} +1 -1
- package/dist/components/{p-BeFUNGEI.js → p-BueaqfA2.js} +1 -1
- package/dist/components/{p-BiByyU2C.js → p-C2l9mZ1P.js} +1 -1
- package/dist/components/{p-CsR4owzk.js → p-C4fKLlrd.js} +1 -1
- package/dist/components/{p-BA0ayKqO.js → p-CBslLN3-.js} +1 -1
- package/dist/components/{p-WotNmY5q.js → p-CHY71o5B.js} +1 -1
- package/dist/components/{p-KQzWumjB.js → p-CI9Nbh-x.js} +1 -1
- package/dist/components/{p-C_X8stam.js → p-CN8IxBlU.js} +1 -1
- package/dist/components/{p-_LbtY-TA.js → p-CWMFGEe0.js} +1 -1
- package/dist/components/{p-Dj_Qjga5.js → p-CYh7yV-K.js} +1 -1
- package/dist/components/{p-xM-_OeRO.js → p-Ck1dhpUQ.js} +1 -1
- package/dist/components/{p-b4gyXoju.js → p-Cns7qSKS.js} +1 -1
- package/dist/components/{p-C69Stayh.js → p-D14QNK3X.js} +1 -1
- package/dist/components/{p-iRL0wQHQ.js → p-D3pNw-SV.js} +1 -1
- package/dist/components/{p-BEJQ2kP7.js → p-D5IhryUR.js} +1 -1
- package/dist/components/{p-CZhyKp-f.js → p-D7yzmu1l.js} +1 -1
- package/dist/components/{p-HLbqRJGs.js → p-DDKjsXCe.js} +1 -1
- package/dist/components/{p-TyR-YTXm.js → p-DV7Z_qfa.js} +1 -1
- package/dist/components/{p-ByR0VXeU.js → p-DWsCbu01.js} +1 -1
- package/dist/components/{p-XS5J5W5_.js → p-DaGZEV0R.js} +1 -1
- package/dist/components/{p-Da46jw3N.js → p-DkWWzVg8.js} +1 -1
- package/dist/components/{p-D1O7DxL4.js → p-Dr3-pKVg.js} +1 -1
- package/dist/components/{p-JdNoaqqb.js → p-Dte67BWd.js} +1 -1
- package/dist/components/{p-CHmi1QWx.js → p-DxzDda_J.js} +1 -1
- package/dist/components/{p-CAIGuV2J.js → p-KJ4dHzrS.js} +1 -1
- package/dist/components/{p-BiouZo1q.js → p-Lhyh6KeB.js} +1 -1
- package/dist/components/{p-CFhp1W9F.js → p-Md9Y-b3d.js} +1 -1
- package/dist/components/{p-C1uR_ZNW.js → p-ZC5YELQJ.js} +1 -1
- package/dist/components/{p-C7SBI_0T.js → p-ZQ2bKafG.js} +1 -1
- package/dist/components/{p-0kShCfeb.js → p-_QEHfsIk.js} +1 -1
- package/dist/components/{p-DXjuuVq9.js → p-gtQlsorg.js} +1 -1
- package/dist/components/{p-GYI7sDxr.js → p-l_YGO7RB.js} +1 -1
- package/dist/components/{p-BK1hLBTd.js → p-m1nVDC3G.js} +1 -1
- package/dist/components/{p-7o2FWtFx.js → p-pCC6t6BH.js} +1 -1
- package/dist/components/p-pGzF7PUB.js +1 -0
- package/dist/esm/{index-MV-81ybv.js → index-BbOHefEf.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/kritzel-active-users_42.entry.js +63 -43
- package/dist/esm/kritzel-brush-style.entry.js +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/stencil.js +3 -3
- package/dist/esm/{workspace.migrations-D6whgl7G.js → workspace.migrations-NhRgr2_H.js} +47 -11
- package/dist/stencil/index.esm.js +1 -1
- package/dist/stencil/p-4a4b38e4.entry.js +9 -0
- package/dist/stencil/{p-fc21e29c.entry.js → p-98238bf9.entry.js} +1 -1
- package/dist/stencil/p-NhRgr2_H.js +1 -0
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/types/components.d.ts +2 -6
- package/dist/types/constants/version.d.ts +1 -1
- package/dist/types/interfaces/engine-state.interface.d.ts +1 -0
- package/package.json +2 -2
- package/dist/components/p-BdGcOXa5.js +0 -9
- package/dist/components/p-_CqLIbO6.js +0 -1
- package/dist/stencil/p-8fe1ec39.entry.js +0 -9
- package/dist/stencil/p-D6whgl7G.js +0 -1
- /package/dist/components/{p-pebXO4LU.js → p-CGGiwvWZ.js} +0 -0
- /package/dist/stencil/{p-MV-81ybv.js → p-BbOHefEf.js} +0 -0
|
@@ -22,7 +22,7 @@ const NAMESPACE = 'stencil';
|
|
|
22
22
|
const BUILD = /* stencil */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
|
|
23
23
|
|
|
24
24
|
/*
|
|
25
|
-
Stencil Client Platform v4.43.
|
|
25
|
+
Stencil Client Platform v4.43.3 | MIT Licensed | https://stenciljs.com
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var workspace_migrations = require('./workspace.migrations-
|
|
3
|
+
var index = require('./index-BRZ6e6oa.js');
|
|
4
|
+
var workspace_migrations = require('./workspace.migrations-sUPrO23c.js');
|
|
5
5
|
var Y = require('yjs');
|
|
6
6
|
require('y-websocket');
|
|
7
7
|
require('y-indexeddb');
|
|
@@ -1891,11 +1891,7 @@ const KritzelEditor = class {
|
|
|
1891
1891
|
showSyncProviderInfo: true,
|
|
1892
1892
|
showMigrationInfo: true,
|
|
1893
1893
|
};
|
|
1894
|
-
user
|
|
1895
|
-
id: `guest-1`,
|
|
1896
|
-
displayName: 'Guest',
|
|
1897
|
-
isGuest: false,
|
|
1898
|
-
};
|
|
1894
|
+
user;
|
|
1899
1895
|
activeUsers;
|
|
1900
1896
|
controls = [
|
|
1901
1897
|
{
|
|
@@ -2044,7 +2040,15 @@ const KritzelEditor = class {
|
|
|
2044
2040
|
providers: [workspace_migrations.HocuspocusSyncProvider, workspace_migrations.IndexedDBSyncProvider]
|
|
2045
2041
|
};
|
|
2046
2042
|
/** Optional login configuration. When provided, a "Sign in" button is shown that opens a login dialog with the configured providers. */
|
|
2047
|
-
loginConfig
|
|
2043
|
+
loginConfig = {
|
|
2044
|
+
providers: [
|
|
2045
|
+
{
|
|
2046
|
+
label: 'Sign in with Google',
|
|
2047
|
+
icon: 'google',
|
|
2048
|
+
name: 'Google',
|
|
2049
|
+
}
|
|
2050
|
+
]
|
|
2051
|
+
};
|
|
2048
2052
|
/** Optional unique identifier for namespacing storage keys across multiple editor instances. */
|
|
2049
2053
|
editorId;
|
|
2050
2054
|
/** Optional workspace ID to set as active. If provided, the editor will automatically activate the workspace with this ID. */
|
|
@@ -2558,7 +2562,7 @@ const KritzelEditor = class {
|
|
|
2558
2562
|
const isLoggedIn = this.isLoggedIn;
|
|
2559
2563
|
const shouldShowCurrentUser = isLoggedIn;
|
|
2560
2564
|
const shouldShowLoginButton = !!this.loginConfig && !isLoggedIn;
|
|
2561
|
-
return (index.h(index.Host, { key: '
|
|
2565
|
+
return (index.h(index.Host, { key: '6dbc3a8c64dd097ba82e46341b3fb97cbd0194db' }, index.h("div", { key: '26ceb62f59ad830fd651a1712f57e5d711e7c6f4', class: "top-left-buttons" }, index.h("kritzel-workspace-manager", { key: 'afb4f5b87c5dc0a673444fb27930e43994df4e02', workspaces: this.workspaces, activeWorkspace: this.activeWorkspace, onWorkspaceChange: event => (this.activeWorkspace = event.detail), onIsWorkspaceManagerReady: () => (this.isWorkspaceManagerReady = true) }), index.h("kritzel-back-to-content", { key: 'f3c0f31841cb819917c3277852bc9b5ce291c09a', visible: this.isBackToContentButtonVisible, onBackToContent: () => this.backToContent() })), index.h("kritzel-engine", { key: '8a9e57132e6b74ec812ee516dc7f0d5fc6c8a2e1', ref: el => (this.engineRef = el), workspace: this.activeWorkspace, activeWorkspaceId: this.activeWorkspaceId, editorId: this.editorId, syncConfig: this.syncConfig, user: this.user, scaleMax: this.scaleMax, lockDrawingScale: this.lockDrawingScale, scaleMin: this.scaleMin, viewportBoundaryLeft: this.viewportBoundaryLeft, viewportBoundaryRight: this.viewportBoundaryRight, viewportBoundaryTop: this.viewportBoundaryTop, viewportBoundaryBottom: this.viewportBoundaryBottom, wheelEnabled: this.wheelEnabled, theme: this.currentTheme, debugInfo: this.debugInfo, globalContextMenuItems: this.globalContextMenuItems, objectContextMenuItems: this.objectContextMenuItems, onIsEngineReady: event => this.onEngineReady(event), onWorkspacesChange: event => this.handleWorkspacesChange(event), onActiveWorkspaceChange: event => this.handleActiveWorkspaceChange(event), onObjectsChange: event => this.handleObjectsChange(event), onObjectsAdded: event => this.handleObjectsAdded(event), onObjectsRemoved: event => this.handleObjectsRemoved(event), onObjectsUpdated: event => this.handleObjectsUpdated(event), onUndoStateChange: event => this.handleUndoStateChange(event), onObjectsInViewportChange: event => this.handleObjectsInViewportChange(event), onViewportChange: event => this.handleViewportChange(event), onAwarenessChange: event => this.handleAwarenessChange(event) }), index.h("kritzel-controls", { key: '6caadf512a0208fecdb18b6d68b17daa522161a3', class: { 'keyboard-open': this.isVirtualKeyboardOpen }, style: { display: this.isControlsVisible ? 'flex' : 'none' }, ref: el => (this.controlsRef = el), controls: this.controls, isUtilityPanelVisible: this.isUtilityPanelVisible, undoState: this.undoState, theme: this.currentTheme, onIsControlsReady: () => (this.isControlsReady = true) }), index.h("div", { key: 'e27e5f3965be2fd15c83b91470ef87c4031dd7a2', class: "top-right-buttons" }, index.h("kritzel-settings", { key: '57f8e75287402aecbb7740d46dfa15839de2169f', ref: el => (this.settingsRef = el), shortcuts: this.shortcuts, editorId: this.editorId, onSettingsChange: event => this.handleSettingsChange(event) }), index.h("kritzel-export", { key: '5ccf176d4fe1221c5d7597bd1c8537cf3324d3ee', ref: el => (this.exportRef = el), workspaceName: this.activeWorkspace?.name || 'workspace', onExportPng: () => this.engineRef.exportViewportAsPng(), onExportSvg: () => this.engineRef.exportViewportAsSvg(), onExportJson: event => this.engineRef.downloadAsJson(event.detail) }), index.h("kritzel-active-users", { key: '44a334b808706e11163e89b91074ca4ea8ab4b18', users: this.activeUsers }), shouldShowCurrentUser && index.h("kritzel-current-user", { key: 'bcb3c966e630b1a8fc4ccd438fc8fbb11cd2b167', user: this.user }), shouldShowLoginButton && index.h("kritzel-button", { key: 'f1957e56257b7c565311e41b770579f7e2bb910d', onButtonClick: () => this.loginDialogRef?.open() }, "Sign in"), index.h("kritzel-more-menu", { key: 'd8c1d1b51cf87725d68aaf4457b88828986a40dc', items: this.moreMenuItems }), index.h("kritzel-share-dialog", { key: 'f5840e7f56cf6897ec28b0f28d9b204037bf3348', ref: el => (this.shareDialogRef = el), isPublic: this.currentIsPublic, workspaceId: this.activeWorkspace?.id, onToggleIsPublic: this.handleToggleIsPublic }), this.loginConfig && (index.h("kritzel-login-dialog", { key: 'cfdcc3d5e7a5e29b0a352f0d4423ae79195dbf69', ref: el => (this.loginDialogRef = el), providers: this.loginConfig.providers, dialogTitle: this.loginConfig.title, subtitle: this.loginConfig.subtitle, onProviderLogin: this.handleProviderLogin })))));
|
|
2562
2566
|
}
|
|
2563
2567
|
static get watchers() { return {
|
|
2564
2568
|
"isEngineReady": [{
|
|
@@ -2607,7 +2611,7 @@ function requireLodash () {
|
|
|
2607
2611
|
var undefined$1;
|
|
2608
2612
|
|
|
2609
2613
|
/** Used as the semantic version number. */
|
|
2610
|
-
var VERSION = '4.
|
|
2614
|
+
var VERSION = '4.18.1';
|
|
2611
2615
|
|
|
2612
2616
|
/** Used as the size to enable large array optimizations. */
|
|
2613
2617
|
var LARGE_ARRAY_SIZE = 200;
|
|
@@ -2615,7 +2619,8 @@ function requireLodash () {
|
|
|
2615
2619
|
/** Error message constants. */
|
|
2616
2620
|
var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
|
|
2617
2621
|
FUNC_ERROR_TEXT = 'Expected a function',
|
|
2618
|
-
INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'
|
|
2622
|
+
INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`',
|
|
2623
|
+
INVALID_TEMPL_IMPORTS_ERROR_TEXT = 'Invalid `imports` option passed into `_.template`';
|
|
2619
2624
|
|
|
2620
2625
|
/** Used to stand-in for `undefined` hash values. */
|
|
2621
2626
|
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
@@ -4347,6 +4352,10 @@ function requireLodash () {
|
|
|
4347
4352
|
* embedded Ruby (ERB) as well as ES2015 template strings. Change the
|
|
4348
4353
|
* following template settings to use alternative delimiters.
|
|
4349
4354
|
*
|
|
4355
|
+
* **Security:** See
|
|
4356
|
+
* [threat model](https://github.com/lodash/lodash/blob/main/threat-model.md)
|
|
4357
|
+
* — `_.template` is insecure and will be removed in v5.
|
|
4358
|
+
*
|
|
4350
4359
|
* @static
|
|
4351
4360
|
* @memberOf _
|
|
4352
4361
|
* @type {Object}
|
|
@@ -4895,7 +4904,7 @@ function requireLodash () {
|
|
|
4895
4904
|
* @name has
|
|
4896
4905
|
* @memberOf SetCache
|
|
4897
4906
|
* @param {*} value The value to search for.
|
|
4898
|
-
* @returns {
|
|
4907
|
+
* @returns {boolean} Returns `true` if `value` is found, else `false`.
|
|
4899
4908
|
*/
|
|
4900
4909
|
function setCacheHas(value) {
|
|
4901
4910
|
return this.__data__.has(value);
|
|
@@ -6966,7 +6975,9 @@ function requireLodash () {
|
|
|
6966
6975
|
function baseUnset(object, path) {
|
|
6967
6976
|
path = castPath(path, object);
|
|
6968
6977
|
|
|
6969
|
-
// Prevent prototype pollution
|
|
6978
|
+
// Prevent prototype pollution:
|
|
6979
|
+
// https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg
|
|
6980
|
+
// https://github.com/lodash/lodash/security/advisories/GHSA-f23m-r3pf-42rh
|
|
6970
6981
|
var index = -1,
|
|
6971
6982
|
length = path.length;
|
|
6972
6983
|
|
|
@@ -6974,32 +6985,17 @@ function requireLodash () {
|
|
|
6974
6985
|
return true;
|
|
6975
6986
|
}
|
|
6976
6987
|
|
|
6977
|
-
var isRootPrimitive = object == null || (typeof object !== 'object' && typeof object !== 'function');
|
|
6978
|
-
|
|
6979
6988
|
while (++index < length) {
|
|
6980
|
-
var key = path[index];
|
|
6981
|
-
|
|
6982
|
-
// skip non-string keys (e.g., Symbols, numbers)
|
|
6983
|
-
if (typeof key !== 'string') {
|
|
6984
|
-
continue;
|
|
6985
|
-
}
|
|
6989
|
+
var key = toKey(path[index]);
|
|
6986
6990
|
|
|
6987
6991
|
// Always block "__proto__" anywhere in the path if it's not expected
|
|
6988
6992
|
if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {
|
|
6989
6993
|
return false;
|
|
6990
6994
|
}
|
|
6991
6995
|
|
|
6992
|
-
// Block
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
typeof path[index + 1] === 'string' &&
|
|
6996
|
-
path[index + 1] === 'prototype') {
|
|
6997
|
-
|
|
6998
|
-
// Allow ONLY when the path starts at a primitive root, e.g., _.unset(0, 'constructor.prototype.a')
|
|
6999
|
-
if (isRootPrimitive && index === 0) {
|
|
7000
|
-
continue;
|
|
7001
|
-
}
|
|
7002
|
-
|
|
6996
|
+
// Block constructor/prototype as non-terminal traversal keys to prevent
|
|
6997
|
+
// escaping the object graph into built-in constructors and prototypes.
|
|
6998
|
+
if ((key === 'constructor' || key === 'prototype') && index < length - 1) {
|
|
7003
6999
|
return false;
|
|
7004
7000
|
}
|
|
7005
7001
|
}
|
|
@@ -9556,7 +9552,7 @@ function requireLodash () {
|
|
|
9556
9552
|
|
|
9557
9553
|
/**
|
|
9558
9554
|
* Creates an array with all falsey values removed. The values `false`, `null`,
|
|
9559
|
-
* `0`, `""`, `undefined`, and `NaN` are
|
|
9555
|
+
* `0`, `-0`, `0n`, `""`, `undefined`, and `NaN` are falsy.
|
|
9560
9556
|
*
|
|
9561
9557
|
* @static
|
|
9562
9558
|
* @memberOf _
|
|
@@ -10095,7 +10091,7 @@ function requireLodash () {
|
|
|
10095
10091
|
|
|
10096
10092
|
while (++index < length) {
|
|
10097
10093
|
var pair = pairs[index];
|
|
10098
|
-
result
|
|
10094
|
+
baseAssignValue(result, pair[0], pair[1]);
|
|
10099
10095
|
}
|
|
10100
10096
|
return result;
|
|
10101
10097
|
}
|
|
@@ -16755,6 +16751,8 @@ function requireLodash () {
|
|
|
16755
16751
|
* **Note:** JavaScript follows the IEEE-754 standard for resolving
|
|
16756
16752
|
* floating-point values which can produce unexpected results.
|
|
16757
16753
|
*
|
|
16754
|
+
* **Note:** If `lower` is greater than `upper`, the values are swapped.
|
|
16755
|
+
*
|
|
16758
16756
|
* @static
|
|
16759
16757
|
* @memberOf _
|
|
16760
16758
|
* @since 0.7.0
|
|
@@ -16768,9 +16766,16 @@ function requireLodash () {
|
|
|
16768
16766
|
* _.random(0, 5);
|
|
16769
16767
|
* // => an integer between 0 and 5
|
|
16770
16768
|
*
|
|
16769
|
+
* // when lower is greater than upper the values are swapped
|
|
16770
|
+
* _.random(5, 0);
|
|
16771
|
+
* // => an integer between 0 and 5
|
|
16772
|
+
*
|
|
16771
16773
|
* _.random(5);
|
|
16772
16774
|
* // => also an integer between 0 and 5
|
|
16773
16775
|
*
|
|
16776
|
+
* _.random(-5);
|
|
16777
|
+
* // => an integer between -5 and 0
|
|
16778
|
+
*
|
|
16774
16779
|
* _.random(5, true);
|
|
16775
16780
|
* // => a floating-point number between 0 and 5
|
|
16776
16781
|
*
|
|
@@ -17372,6 +17377,10 @@ function requireLodash () {
|
|
|
17372
17377
|
* properties may be accessed as free variables in the template. If a setting
|
|
17373
17378
|
* object is given, it takes precedence over `_.templateSettings` values.
|
|
17374
17379
|
*
|
|
17380
|
+
* **Security:** `_.template` is insecure and should not be used. It will be
|
|
17381
|
+
* removed in Lodash v5. Avoid untrusted input. See
|
|
17382
|
+
* [threat model](https://github.com/lodash/lodash/blob/main/threat-model.md).
|
|
17383
|
+
*
|
|
17375
17384
|
* **Note:** In the development build `_.template` utilizes
|
|
17376
17385
|
* [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
|
|
17377
17386
|
* for easier debugging.
|
|
@@ -17479,12 +17488,18 @@ function requireLodash () {
|
|
|
17479
17488
|
options = undefined$1;
|
|
17480
17489
|
}
|
|
17481
17490
|
string = toString(string);
|
|
17482
|
-
options =
|
|
17491
|
+
options = assignWith({}, options, settings, customDefaultsAssignIn);
|
|
17483
17492
|
|
|
17484
|
-
var imports =
|
|
17493
|
+
var imports = assignWith({}, options.imports, settings.imports, customDefaultsAssignIn),
|
|
17485
17494
|
importsKeys = keys(imports),
|
|
17486
17495
|
importsValues = baseValues(imports, importsKeys);
|
|
17487
17496
|
|
|
17497
|
+
arrayEach(importsKeys, function(key) {
|
|
17498
|
+
if (reForbiddenIdentifierChars.test(key)) {
|
|
17499
|
+
throw new Error(INVALID_TEMPL_IMPORTS_ERROR_TEXT);
|
|
17500
|
+
}
|
|
17501
|
+
});
|
|
17502
|
+
|
|
17488
17503
|
var isEscaping,
|
|
17489
17504
|
isEvaluating,
|
|
17490
17505
|
index = 0,
|
|
@@ -20911,6 +20926,7 @@ const DEFAULT_ENGINE_CONFIG = {
|
|
|
20911
20926
|
isDrawing: false,
|
|
20912
20927
|
isErasing: false,
|
|
20913
20928
|
isWriting: false,
|
|
20929
|
+
isWorkspaceLoading: false,
|
|
20914
20930
|
isCtrlKeyPressed: false,
|
|
20915
20931
|
isContextMenuVisible: false,
|
|
20916
20932
|
contextMenuItems: [],
|
|
@@ -25490,7 +25506,7 @@ async function toPng(node, options = {}) {
|
|
|
25490
25506
|
return canvas.toDataURL();
|
|
25491
25507
|
}
|
|
25492
25508
|
|
|
25493
|
-
const kritzelEngineCss = () => `:host{display:block;position:relative;height:100%;width:100%;overflow:hidden;background-color:var(--kritzel-engine-background-color, #ffffff)}:host,:host *{touch-action:none;user-select:none}.ProseMirror{outline:none}p,h1,h2,h3,h4,h5,h6,blockquote,pre{margin:0;padding:0}.debug-panel{position:absolute;pointer-events:none;top:0;right:0}.origin{position:relative;top:0;left:0;height:0;width:0;pointer-events:none;-webkit-transform-origin:top left;-moz-transform-origin:top left;transform-origin:top left;overflow:visible}.object{overflow:visible}.PlaygroundEditorTheme__quote{margin:0;margin-left:20px;margin-bottom:10px;font-size:15px;color:rgb(101, 103, 107);border-left-color:rgb(206, 208, 212);border-left-width:4px;border-left-style:solid;padding-left:16px}`;
|
|
25509
|
+
const kritzelEngineCss = () => `:host{display:block;position:relative;height:100%;width:100%;overflow:hidden;background-color:var(--kritzel-engine-background-color, #ffffff)}:host,:host *{touch-action:none;user-select:none}.ProseMirror{outline:none}p,h1,h2,h3,h4,h5,h6,blockquote,pre{margin:0;padding:0}.workspace-loading-overlay{position:absolute;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;background-color:var(--kritzel-loading-overlay-background, rgba(255, 255, 255, 0.6));color:var(--kritzel-loading-overlay-color, #333);font-size:1.25rem;pointer-events:all;animation:workspace-loading-fade-in var(--kritzel-loading-overlay-delay, 300ms) ease-out forwards;opacity:0}@keyframes workspace-loading-fade-in{to{opacity:1}}.debug-panel{position:absolute;pointer-events:none;top:0;right:0}.origin{position:relative;top:0;left:0;height:0;width:0;pointer-events:none;-webkit-transform-origin:top left;-moz-transform-origin:top left;transform-origin:top left;overflow:visible}.object{overflow:visible}.PlaygroundEditorTheme__quote{margin:0;margin-left:20px;margin-bottom:10px;font-size:15px;color:rgb(101, 103, 107);border-left-color:rgb(206, 208, 212);border-left-width:4px;border-left-style:solid;padding-left:16px}`;
|
|
25494
25510
|
|
|
25495
25511
|
const KritzelEngine = class {
|
|
25496
25512
|
get host() { return index.getElement(this); }
|
|
@@ -26802,6 +26818,7 @@ const KritzelEngine = class {
|
|
|
26802
26818
|
await this._workspaceInitializationPromise;
|
|
26803
26819
|
return;
|
|
26804
26820
|
}
|
|
26821
|
+
this.core.store.state.isWorkspaceLoading = true;
|
|
26805
26822
|
const initializationPromise = this.core.initializeWorkspace(workspace, options);
|
|
26806
26823
|
this._workspaceInitializationPromise = initializationPromise;
|
|
26807
26824
|
this._workspaceInitializationTargetKey = targetKey;
|
|
@@ -26813,6 +26830,7 @@ const KritzelEngine = class {
|
|
|
26813
26830
|
this._workspaceInitializationPromise = null;
|
|
26814
26831
|
this._workspaceInitializationTargetKey = null;
|
|
26815
26832
|
}
|
|
26833
|
+
this.core.store.state.isWorkspaceLoading = false;
|
|
26816
26834
|
}
|
|
26817
26835
|
}
|
|
26818
26836
|
emitObjectsChange() {
|
|
@@ -26880,7 +26898,7 @@ const KritzelEngine = class {
|
|
|
26880
26898
|
this.emitObjectsInViewportChange();
|
|
26881
26899
|
}
|
|
26882
26900
|
}
|
|
26883
|
-
return (index.h(index.Host, null, this.core.store.state.debugInfo.showViewportInfo && (index.h("div", { class: "debug-panel" }, index.h("div", null, "ActiveWorkspaceId: ", this.core.store.state?.activeWorkspace?.id), index.h("div", null, "ActiveWorkspaceName: ", this.core.store.state?.activeWorkspace?.name), index.h("div", null, "TranslateX: ", this.core.store.state?.translateX), index.h("div", null, "TranslateY: ", this.core.store.state?.translateY), index.h("div", null, "ViewportWidth: ", this.core.store.state?.viewportWidth), index.h("div", null, "ViewportHeight: ", this.core.store.state?.viewportHeight), index.h("div", null, "PointerCount: ", this.core.store.state.pointers.size), index.h("div", null, "Scale: ", this.core.store.state?.scale), index.h("div", null, "ActiveTool: ", this.core.store.state?.activeTool?.name), index.h("div", null, "HasViewportChanged: ", this.core.store.state?.hasViewportChanged ? 'true' : 'false'), index.h("div", null, "IsEnabled: ", this.core.store.state?.isEnabled ? 'true' : 'false'), index.h("div", null, "IsScaling: ", this.core.store.state?.isScaling ? 'true' : 'false'), index.h("div", null, "IsPanning: ", this.core.store.state?.isPanning ? 'true' : 'false'), index.h("div", null, "IsSelecting: ", this.isSelecting ? 'true' : 'false'), index.h("div", null, "IsSelectionActive: ", this.isSelectionActive ? 'true' : 'false'), index.h("div", null, "IsResizeHandleSelected: ", this.core.store.state.isResizeHandleSelected ? 'true' : 'false'), index.h("div", null, "IsRotationHandleSelected: ", this.core.store.state.isRotationHandleSelected ? 'true' : 'false'), index.h("div", null, "IsRotationHandleHovered: ", this.core.store.state.isRotationHandleHovered ? 'true' : 'false'), index.h("div", null, "IsDrawing: ", this.core.store.state.isDrawing ? 'true' : 'false'), index.h("div", null, "IsWriting: ", this.core.store.state.isWriting ? 'true' : 'false'), index.h("div", null, "IsPointerDown: ", this.core.store.isPointerDown ? 'true' : 'false'), index.h("div", null, "PointerX: ", this.core.store.state?.pointerX), index.h("div", null, "PointerY: ", this.core.store.state?.pointerY), index.h("div", null, "TotalObjects: ", this.core.store.totalObjectCount), index.h("div", null, "ObjectsInViewport: ", this.core.store.objectsInViewport.length), index.h("div", null, "SelectedObjects: ", this.core.store.selectionGroup?.objects.length || 0), index.h("div", null, "ViewportCenter: (", viewportCenterX.toFixed(2), ", ", viewportCenterY.toFixed(2), ")"))), index.h("div", { id: "origin", class: "origin", style: {
|
|
26901
|
+
return (index.h(index.Host, null, this.core.store.state.isWorkspaceLoading && (index.h("div", { class: "workspace-loading-overlay" }, "Loading...")), this.core.store.state.debugInfo.showViewportInfo && (index.h("div", { class: "debug-panel" }, index.h("div", null, "ActiveWorkspaceId: ", this.core.store.state?.activeWorkspace?.id), index.h("div", null, "ActiveWorkspaceName: ", this.core.store.state?.activeWorkspace?.name), index.h("div", null, "TranslateX: ", this.core.store.state?.translateX), index.h("div", null, "TranslateY: ", this.core.store.state?.translateY), index.h("div", null, "ViewportWidth: ", this.core.store.state?.viewportWidth), index.h("div", null, "ViewportHeight: ", this.core.store.state?.viewportHeight), index.h("div", null, "PointerCount: ", this.core.store.state.pointers.size), index.h("div", null, "Scale: ", this.core.store.state?.scale), index.h("div", null, "ActiveTool: ", this.core.store.state?.activeTool?.name), index.h("div", null, "HasViewportChanged: ", this.core.store.state?.hasViewportChanged ? 'true' : 'false'), index.h("div", null, "IsEnabled: ", this.core.store.state?.isEnabled ? 'true' : 'false'), index.h("div", null, "IsScaling: ", this.core.store.state?.isScaling ? 'true' : 'false'), index.h("div", null, "IsPanning: ", this.core.store.state?.isPanning ? 'true' : 'false'), index.h("div", null, "IsSelecting: ", this.isSelecting ? 'true' : 'false'), index.h("div", null, "IsSelectionActive: ", this.isSelectionActive ? 'true' : 'false'), index.h("div", null, "IsResizeHandleSelected: ", this.core.store.state.isResizeHandleSelected ? 'true' : 'false'), index.h("div", null, "IsRotationHandleSelected: ", this.core.store.state.isRotationHandleSelected ? 'true' : 'false'), index.h("div", null, "IsRotationHandleHovered: ", this.core.store.state.isRotationHandleHovered ? 'true' : 'false'), index.h("div", null, "IsDrawing: ", this.core.store.state.isDrawing ? 'true' : 'false'), index.h("div", null, "IsWriting: ", this.core.store.state.isWriting ? 'true' : 'false'), index.h("div", null, "IsPointerDown: ", this.core.store.isPointerDown ? 'true' : 'false'), index.h("div", null, "PointerX: ", this.core.store.state?.pointerX), index.h("div", null, "PointerY: ", this.core.store.state?.pointerY), index.h("div", null, "TotalObjects: ", this.core.store.totalObjectCount), index.h("div", null, "ObjectsInViewport: ", this.core.store.objectsInViewport.length), index.h("div", null, "SelectedObjects: ", this.core.store.selectionGroup?.objects.length || 0), index.h("div", null, "ViewportCenter: (", viewportCenterX.toFixed(2), ", ", viewportCenterY.toFixed(2), ")"))), index.h("div", { id: "origin", class: "origin", style: {
|
|
26884
26902
|
transform: `matrix(${this.core.store.state?.scale}, 0, 0, ${this.core.store.state?.scale}, ${this.core.store.state?.translateX}, ${this.core.store.state?.translateY})`,
|
|
26885
26903
|
} }, visibleObjects?.map(object => {
|
|
26886
26904
|
return (index.h("div", { key: object.id, id: object.id, class: "object", style: {
|
|
@@ -27031,14 +27049,16 @@ const KritzelEngine = class {
|
|
|
27031
27049
|
(() => {
|
|
27032
27050
|
const isSelectionGroup = workspace_migrations.KritzelClassHelper.isInstanceOf(object, 'KritzelSelectionGroup');
|
|
27033
27051
|
const localClientId = this.core.store.state.objects?.localClientId;
|
|
27052
|
+
const awarenessStates = this.core.store.state.objects?.awareness?.getStates();
|
|
27034
27053
|
const isRemoteSelection = isSelectionGroup && (
|
|
27035
27054
|
// Different user
|
|
27036
27055
|
(object.userId != null && this.core.user?.id != null && object.userId !== this.core.user.id) ||
|
|
27037
|
-
// Same user but different client (e.g. same account
|
|
27038
|
-
(object.
|
|
27056
|
+
// Same user but different client that is still actively connected (e.g. same account on another device)
|
|
27057
|
+
(object.userId != null && this.core.user?.id != null && object.userId === this.core.user.id &&
|
|
27058
|
+
object.clientId != null && localClientId != null && object.clientId !== localClientId &&
|
|
27059
|
+
awarenessStates?.has(object.clientId) === true));
|
|
27039
27060
|
let remoteUserColor;
|
|
27040
27061
|
if (isRemoteSelection) {
|
|
27041
|
-
const awarenessStates = this.core.store.state.objects?.awareness?.getStates();
|
|
27042
27062
|
if (awarenessStates) {
|
|
27043
27063
|
// Try direct lookup by clientId first (most precise)
|
|
27044
27064
|
if (isSelectionGroup && object.clientId != null) {
|
|
@@ -27641,7 +27661,7 @@ const KritzelLineEndings = class {
|
|
|
27641
27661
|
};
|
|
27642
27662
|
KritzelLineEndings.style = kritzelLineEndingsCss();
|
|
27643
27663
|
|
|
27644
|
-
const kritzelLoginDialogCss = () => `:host{display:contents}kritzel-dialog{--kritzel-dialog-width-small:380px}.login-content{display:flex;flex-direction:column;gap:20px}.login-subtitle{font-size:13px;color:var(--kritzel-login-dialog-subtitle-color, #666666);margin:0;line-height:1.5;text-align:center}.login-providers{display:flex;flex-direction:column;gap:10px}.provider-button{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;padding:12px 16px;border:1px solid var(--kritzel-login-dialog-button-border-color, #e0e0e0);border-radius:8px;background:var(--kritzel-login-dialog-button-background, #ffffff);color:var(--kritzel-login-dialog-button-text-color, #333333);font-size:14px;font-weight:500;font-family:inherit;cursor:var(--kritzel-global-pointer-cursor, pointer);transition:background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;-webkit-tap-highlight-color:transparent}.provider-button:hover:not(:disabled){background:var(--kritzel-login-dialog-button-hover-background, #f5f5f5);border-color:var(--kritzel-login-dialog-button-hover-border-color, #cccccc)}.provider-button:active:not(:disabled){background:var(--kritzel-login-dialog-button-active-background, #ebebeb)}.provider-button:focus-visible{outline:revert;outline-offset:revert}.provider-button.is-disabled{opacity:0.5;cursor:default;pointer-events:none}.provider-button.is-loading{cursor:default}.provider-label{flex-shrink:0}.provider-button.is-loading .provider-label{opacity:0.7}@keyframes kritzel-login-spin{to{transform:rotate(360deg)}}.spinner{width:20px;height:20px;border:2px solid var(--kritzel-login-dialog-spinner-color, #cccccc);border-top-color:var(--kritzel-login-dialog-spinner-active-color, #333333);border-radius:50%;animation:kritzel-login-spin 0.6s linear infinite}`;
|
|
27664
|
+
const kritzelLoginDialogCss = () => `:host{display:contents}kritzel-dialog{--kritzel-dialog-width-small:380px}.login-content{display:flex;flex-direction:column;gap:20px}.login-subtitle{font-size:13px;color:var(--kritzel-login-dialog-subtitle-color, #666666);margin:0;line-height:1.5;text-align:center}.login-providers{display:flex;flex-direction:column;gap:10px}.provider-button{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;padding:12px 16px;border:1px solid var(--kritzel-login-dialog-button-border-color, #e0e0e0);border-radius:8px;background:var(--kritzel-login-dialog-button-background, #ffffff);color:var(--kritzel-login-dialog-button-text-color, #333333);font-size:14px;font-weight:500;font-family:inherit;cursor:var(--kritzel-global-pointer-cursor, pointer);transition:background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;-webkit-tap-highlight-color:transparent}.provider-button:hover:not(:disabled){background:var(--kritzel-login-dialog-button-hover-background, #f5f5f5);border-color:var(--kritzel-login-dialog-button-hover-border-color, #cccccc)}.provider-button:active:not(:disabled){background:var(--kritzel-login-dialog-button-active-background, #ebebeb)}.provider-button:focus-visible{outline:revert;outline-offset:revert}.provider-button.is-disabled{opacity:0.5;cursor:default;pointer-events:none}.provider-button.is-loading{cursor:default}.provider-label{flex-shrink:0}.provider-button.is-loading .provider-label{opacity:0.7}@keyframes kritzel-login-spin{to{transform:rotate(360deg)}}.spinner{width:20px;height:20px;box-sizing:border-box;display:block;flex-shrink:0;border:2px solid var(--kritzel-login-dialog-spinner-color, #cccccc);border-top-color:var(--kritzel-login-dialog-spinner-active-color, #333333);border-radius:50%;animation:kritzel-login-spin 0.6s linear infinite}`;
|
|
27645
27665
|
|
|
27646
27666
|
const KritzelLoginDialog = class {
|
|
27647
27667
|
constructor(hostRef) {
|
|
@@ -28539,7 +28559,7 @@ const KritzelPortal = class {
|
|
|
28539
28559
|
* This file is auto-generated by the version bump scripts.
|
|
28540
28560
|
* Do not modify manually.
|
|
28541
28561
|
*/
|
|
28542
|
-
const KRITZEL_VERSION = '0.1.
|
|
28562
|
+
const KRITZEL_VERSION = '0.1.78';
|
|
28543
28563
|
|
|
28544
28564
|
const kritzelSettingsCss = () => `:host{display:contents}kritzel-dialog{--kritzel-dialog-body-padding:0;--kritzel-dialog-width-large:800px;--kritzel-dialog-height-large:500px}.footer-button{padding:8px 16px;border-radius:6px;cursor:pointer;font-size:14px}.cancel-button{border:1px solid #ebebeb;background:#fff;color:inherit}.cancel-button:hover{background:#f5f5f5}.settings-content{padding:0}.settings-content h3{margin:0 0 16px 0;font-size:18px;font-weight:600;color:var(--kritzel-settings-content-heading-color, #333333)}.settings-content p{margin:0;font-size:14px;color:var(--kritzel-settings-content-text-color, #666666);line-height:1.5}.settings-group{display:flex;flex-direction:column;gap:24px}.settings-item{display:flex;flex-direction:column;gap:8px}.settings-row{display:flex;align-items:center;justify-content:space-between;gap:16px}.settings-label{font-size:14px;font-weight:600;color:var(--kritzel-settings-label-color, #333333);margin:0 0 4px 0}.settings-description{font-size:12px;color:var(--kritzel-settings-description-color, #888888);margin:0;line-height:1.4}.shortcuts-list{display:flex;flex-direction:column;gap:24px}.shortcuts-category{display:flex;flex-direction:column;gap:8px}.shortcuts-category-title{font-size:14px;font-weight:600;color:var(--kritzel-settings-label-color, #333333);margin:0 0 4px 0}.shortcuts-group{display:flex;flex-direction:column;gap:4px}.shortcut-item{display:flex;justify-content:space-between;align-items:center;padding:6px 8px;border-radius:4px;background:var(--kritzel-settings-shortcut-item-bg, rgba(0, 0, 0, 0.02))}.shortcut-label{font-size:14px;color:var(--kritzel-settings-content-text-color, #666666)}.shortcut-key{font-family:monospace;font-size:12px;padding:2px 8px;border-radius:4px;background:var(--kritzel-settings-shortcut-key-bg, #f0f0f0);color:var(--kritzel-settings-shortcut-key-color, #333333);border:1px solid var(--kritzel-settings-shortcut-key-border, #ddd)}`;
|
|
28545
28565
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BRZ6e6oa.js');
|
|
4
4
|
|
|
5
5
|
const kritzelBrushStyleCss = () => `:host{display:flex;align-items:flex-start;gap:8px;padding:8px;box-sizing:border-box;width:100%}.brush-style-button{display:flex;justify-content:center;align-items:center;width:42px;height:32px;padding:0;border:none;outline:none;background:none;border-radius:0;color:var(--control-text-color);font-weight:bold;-webkit-tap-highlight-color:transparent}.font-style-button:not(:last-child){border-right:1px solid #333333}.font-style-button:hover{background-color:var(--control-hover-bg)}.font-style-button:active{background-color:var(--control-active-bg)}.font-style-button.selected,.font-style-button.selected:hover,.font-style-button.selected:active{background-color:var(--control-selected-bg);color:var(--control-selected-color)}`;
|
|
6
6
|
|
package/dist/cjs/loader.cjs.js
CHANGED
package/dist/cjs/stencil.cjs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BRZ6e6oa.js');
|
|
4
4
|
var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
5
5
|
|
|
6
6
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Browser v4.43.
|
|
8
|
+
Stencil Client Patch Browser v4.43.3 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
var patchBrowser = () => {
|
|
@@ -5054,7 +5054,8 @@ class ReplaceStep extends Step {
|
|
|
5054
5054
|
return new ReplaceStep(this.from, this.from + this.slice.size, doc.slice(this.from, this.to));
|
|
5055
5055
|
}
|
|
5056
5056
|
map(mapping) {
|
|
5057
|
-
let
|
|
5057
|
+
let to = mapping.mapResult(this.to, -1);
|
|
5058
|
+
let from = this.from == this.to && ReplaceStep.MAP_BIAS < 0 ? to : mapping.mapResult(this.from, 1);
|
|
5058
5059
|
if (from.deletedAcross && to.deletedAcross)
|
|
5059
5060
|
return null;
|
|
5060
5061
|
return new ReplaceStep(from.pos, Math.max(from.pos, to.pos), this.slice, this.structure);
|
|
@@ -5093,6 +5094,15 @@ class ReplaceStep extends Step {
|
|
|
5093
5094
|
return new ReplaceStep(json.from, json.to, Slice.fromJSON(schema, json.slice), !!json.structure);
|
|
5094
5095
|
}
|
|
5095
5096
|
}
|
|
5097
|
+
/**
|
|
5098
|
+
By default, for backwards compatibility, an inserting step
|
|
5099
|
+
mapped over an insertion at that same position fill move after
|
|
5100
|
+
the inserted content. In a collaborative editing situation, that
|
|
5101
|
+
can make redone insertions appear in unexpected places. You can
|
|
5102
|
+
set this to -1 to make such mapping keep the step before the
|
|
5103
|
+
insertion instead.
|
|
5104
|
+
*/
|
|
5105
|
+
ReplaceStep.MAP_BIAS = 1;
|
|
5096
5106
|
Step.jsonID("replace", ReplaceStep);
|
|
5097
5107
|
/**
|
|
5098
5108
|
Replace a part of the document with a slice of content, but
|
|
@@ -6010,6 +6020,26 @@ function replaceRangeWith(tr, from, to, node) {
|
|
|
6010
6020
|
}
|
|
6011
6021
|
function deleteRange(tr, from, to) {
|
|
6012
6022
|
let $from = tr.doc.resolve(from), $to = tr.doc.resolve(to);
|
|
6023
|
+
// When the deleted range spans from the start of one textblock to
|
|
6024
|
+
// the start of another one, move out of the start of both blocks.
|
|
6025
|
+
if ($from.parent.isTextblock && $to.parent.isTextblock && $from.start() != $to.start() &&
|
|
6026
|
+
$from.parentOffset == 0 && $to.parentOffset == 0) {
|
|
6027
|
+
let shared = $from.sharedDepth(to), isolated = false;
|
|
6028
|
+
for (let d = $from.depth; d > shared; d--)
|
|
6029
|
+
if ($from.node(d).type.spec.isolating)
|
|
6030
|
+
isolated = true;
|
|
6031
|
+
for (let d = $to.depth; d > shared; d--)
|
|
6032
|
+
if ($to.node(d).type.spec.isolating)
|
|
6033
|
+
isolated = true;
|
|
6034
|
+
if (!isolated) {
|
|
6035
|
+
for (let d = $from.depth; d > 0 && from == $from.start(d); d--)
|
|
6036
|
+
from = $from.before(d);
|
|
6037
|
+
for (let d = $to.depth; d > 0 && to == $to.start(d); d--)
|
|
6038
|
+
to = $to.before(d);
|
|
6039
|
+
$from = tr.doc.resolve(from);
|
|
6040
|
+
$to = tr.doc.resolve(to);
|
|
6041
|
+
}
|
|
6042
|
+
}
|
|
6013
6043
|
let covered = coveredDepths($from, $to);
|
|
6014
6044
|
for (let i = 0; i < covered.length; i++) {
|
|
6015
6045
|
let depth = covered[i], last = i == covered.length - 1;
|
|
@@ -10778,8 +10808,8 @@ class MouseDown {
|
|
|
10778
10808
|
this.target = targetDesc && targetDesc.nodeDOM.nodeType == 1 ? targetDesc.nodeDOM : null;
|
|
10779
10809
|
let { selection } = view.state;
|
|
10780
10810
|
if (event.button == 0 &&
|
|
10781
|
-
targetNode.type.spec.draggable && targetNode.type.spec.selectable !== false ||
|
|
10782
|
-
|
|
10811
|
+
(targetNode.type.spec.draggable && targetNode.type.spec.selectable !== false ||
|
|
10812
|
+
selection instanceof NodeSelection && selection.from <= targetPos && selection.to > targetPos))
|
|
10783
10813
|
this.mightDrag = {
|
|
10784
10814
|
node: targetNode,
|
|
10785
10815
|
pos: targetPos,
|
|
@@ -11128,8 +11158,9 @@ class Dragging {
|
|
|
11128
11158
|
}
|
|
11129
11159
|
const dragCopyModifier = mac$3 ? "altKey" : "ctrlKey";
|
|
11130
11160
|
function dragMoves(view, event) {
|
|
11131
|
-
let
|
|
11132
|
-
|
|
11161
|
+
let copy;
|
|
11162
|
+
view.someProp("dragCopies", test => { copy = copy || test(event); });
|
|
11163
|
+
return copy != null ? !copy : !event[dragCopyModifier];
|
|
11133
11164
|
}
|
|
11134
11165
|
handlers.dragstart = (view, _event) => {
|
|
11135
11166
|
let event = _event;
|
|
@@ -11156,7 +11187,7 @@ handlers.dragstart = (view, _event) => {
|
|
|
11156
11187
|
if (!event.dataTransfer.files.length || !chrome || chrome_version > 120)
|
|
11157
11188
|
event.dataTransfer.clearData();
|
|
11158
11189
|
event.dataTransfer.setData(brokenClipboardAPI ? "Text" : "text/html", dom.innerHTML);
|
|
11159
|
-
// See https://
|
|
11190
|
+
// See https://code.haverbeke.berlin/prosemirror/prosemirror/issues/1156
|
|
11160
11191
|
event.dataTransfer.effectAllowed = "copyMove";
|
|
11161
11192
|
if (!brokenClipboardAPI)
|
|
11162
11193
|
event.dataTransfer.setData("text/plain", text);
|
|
@@ -12155,8 +12186,13 @@ class DOMObserver {
|
|
|
12155
12186
|
for (let node of added)
|
|
12156
12187
|
if (node.nodeName == "BR" && node.parentNode) {
|
|
12157
12188
|
let after = node.nextSibling;
|
|
12158
|
-
|
|
12159
|
-
|
|
12189
|
+
while (after && after.nodeType == 1) {
|
|
12190
|
+
if (after.contentEditable == "false") {
|
|
12191
|
+
node.parentNode.removeChild(node);
|
|
12192
|
+
break;
|
|
12193
|
+
}
|
|
12194
|
+
after = after.firstChild;
|
|
12195
|
+
}
|
|
12160
12196
|
}
|
|
12161
12197
|
}
|
|
12162
12198
|
else if (gecko && added.length) {
|
|
@@ -12776,7 +12812,7 @@ class EditorView {
|
|
|
12776
12812
|
this.pluginViews = [];
|
|
12777
12813
|
/**
|
|
12778
12814
|
Holds `true` when a hack node is needed in Firefox to prevent the
|
|
12779
|
-
[space is eaten issue](https://
|
|
12815
|
+
[space is eaten issue](https://code.haverbeke.berlin/prosemirror/prosemirror/issues/651)
|
|
12780
12816
|
@internal
|
|
12781
12817
|
*/
|
|
12782
12818
|
this.requiresGeckoHackNode = false;
|
|
@@ -12994,12 +13030,12 @@ class EditorView {
|
|
|
12994
13030
|
}
|
|
12995
13031
|
updateDraggedNode(dragging, prev) {
|
|
12996
13032
|
let sel = dragging.node, found = -1;
|
|
12997
|
-
if (this.state.doc.nodeAt(sel.from) == sel.node) {
|
|
13033
|
+
if (sel.from < this.state.doc.content.size && this.state.doc.nodeAt(sel.from) == sel.node) {
|
|
12998
13034
|
found = sel.from;
|
|
12999
13035
|
}
|
|
13000
13036
|
else {
|
|
13001
13037
|
let movedPos = sel.from + (this.state.doc.content.size - prev.doc.content.size);
|
|
13002
|
-
let moved = movedPos > 0 && this.state.doc.nodeAt(movedPos);
|
|
13038
|
+
let moved = movedPos > 0 && movedPos < this.state.doc.content.size && this.state.doc.nodeAt(movedPos);
|
|
13003
13039
|
if (moved == sel.node)
|
|
13004
13040
|
found = movedPos;
|
|
13005
13041
|
}
|
|
@@ -35,11 +35,7 @@ export class KritzelEditor {
|
|
|
35
35
|
showSyncProviderInfo: true,
|
|
36
36
|
showMigrationInfo: true,
|
|
37
37
|
};
|
|
38
|
-
user
|
|
39
|
-
id: `guest-1`,
|
|
40
|
-
displayName: 'Guest',
|
|
41
|
-
isGuest: false,
|
|
42
|
-
};
|
|
38
|
+
user;
|
|
43
39
|
activeUsers;
|
|
44
40
|
controls = [
|
|
45
41
|
{
|
|
@@ -188,7 +184,15 @@ export class KritzelEditor {
|
|
|
188
184
|
providers: [HocuspocusSyncProvider, IndexedDBSyncProvider]
|
|
189
185
|
};
|
|
190
186
|
/** Optional login configuration. When provided, a "Sign in" button is shown that opens a login dialog with the configured providers. */
|
|
191
|
-
loginConfig
|
|
187
|
+
loginConfig = {
|
|
188
|
+
providers: [
|
|
189
|
+
{
|
|
190
|
+
label: 'Sign in with Google',
|
|
191
|
+
icon: 'google',
|
|
192
|
+
name: 'Google',
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
};
|
|
192
196
|
/** Optional unique identifier for namespacing storage keys across multiple editor instances. */
|
|
193
197
|
editorId;
|
|
194
198
|
/** Optional workspace ID to set as active. If provided, the editor will automatically activate the workspace with this ID. */
|
|
@@ -702,7 +706,7 @@ export class KritzelEditor {
|
|
|
702
706
|
const isLoggedIn = this.isLoggedIn;
|
|
703
707
|
const shouldShowCurrentUser = isLoggedIn;
|
|
704
708
|
const shouldShowLoginButton = !!this.loginConfig && !isLoggedIn;
|
|
705
|
-
return (h(Host, { key: '
|
|
709
|
+
return (h(Host, { key: '6dbc3a8c64dd097ba82e46341b3fb97cbd0194db' }, h("div", { key: '26ceb62f59ad830fd651a1712f57e5d711e7c6f4', class: "top-left-buttons" }, h("kritzel-workspace-manager", { key: 'afb4f5b87c5dc0a673444fb27930e43994df4e02', workspaces: this.workspaces, activeWorkspace: this.activeWorkspace, onWorkspaceChange: event => (this.activeWorkspace = event.detail), onIsWorkspaceManagerReady: () => (this.isWorkspaceManagerReady = true) }), h("kritzel-back-to-content", { key: 'f3c0f31841cb819917c3277852bc9b5ce291c09a', visible: this.isBackToContentButtonVisible, onBackToContent: () => this.backToContent() })), h("kritzel-engine", { key: '8a9e57132e6b74ec812ee516dc7f0d5fc6c8a2e1', ref: el => (this.engineRef = el), workspace: this.activeWorkspace, activeWorkspaceId: this.activeWorkspaceId, editorId: this.editorId, syncConfig: this.syncConfig, user: this.user, scaleMax: this.scaleMax, lockDrawingScale: this.lockDrawingScale, scaleMin: this.scaleMin, viewportBoundaryLeft: this.viewportBoundaryLeft, viewportBoundaryRight: this.viewportBoundaryRight, viewportBoundaryTop: this.viewportBoundaryTop, viewportBoundaryBottom: this.viewportBoundaryBottom, wheelEnabled: this.wheelEnabled, theme: this.currentTheme, debugInfo: this.debugInfo, globalContextMenuItems: this.globalContextMenuItems, objectContextMenuItems: this.objectContextMenuItems, onIsEngineReady: event => this.onEngineReady(event), onWorkspacesChange: event => this.handleWorkspacesChange(event), onActiveWorkspaceChange: event => this.handleActiveWorkspaceChange(event), onObjectsChange: event => this.handleObjectsChange(event), onObjectsAdded: event => this.handleObjectsAdded(event), onObjectsRemoved: event => this.handleObjectsRemoved(event), onObjectsUpdated: event => this.handleObjectsUpdated(event), onUndoStateChange: event => this.handleUndoStateChange(event), onObjectsInViewportChange: event => this.handleObjectsInViewportChange(event), onViewportChange: event => this.handleViewportChange(event), onAwarenessChange: event => this.handleAwarenessChange(event) }), h("kritzel-controls", { key: '6caadf512a0208fecdb18b6d68b17daa522161a3', class: { 'keyboard-open': this.isVirtualKeyboardOpen }, style: { display: this.isControlsVisible ? 'flex' : 'none' }, ref: el => (this.controlsRef = el), controls: this.controls, isUtilityPanelVisible: this.isUtilityPanelVisible, undoState: this.undoState, theme: this.currentTheme, onIsControlsReady: () => (this.isControlsReady = true) }), h("div", { key: 'e27e5f3965be2fd15c83b91470ef87c4031dd7a2', class: "top-right-buttons" }, h("kritzel-settings", { key: '57f8e75287402aecbb7740d46dfa15839de2169f', ref: el => (this.settingsRef = el), shortcuts: this.shortcuts, editorId: this.editorId, onSettingsChange: event => this.handleSettingsChange(event) }), h("kritzel-export", { key: '5ccf176d4fe1221c5d7597bd1c8537cf3324d3ee', ref: el => (this.exportRef = el), workspaceName: this.activeWorkspace?.name || 'workspace', onExportPng: () => this.engineRef.exportViewportAsPng(), onExportSvg: () => this.engineRef.exportViewportAsSvg(), onExportJson: event => this.engineRef.downloadAsJson(event.detail) }), h("kritzel-active-users", { key: '44a334b808706e11163e89b91074ca4ea8ab4b18', users: this.activeUsers }), shouldShowCurrentUser && h("kritzel-current-user", { key: 'bcb3c966e630b1a8fc4ccd438fc8fbb11cd2b167', user: this.user }), shouldShowLoginButton && h("kritzel-button", { key: 'f1957e56257b7c565311e41b770579f7e2bb910d', onButtonClick: () => this.loginDialogRef?.open() }, "Sign in"), h("kritzel-more-menu", { key: 'd8c1d1b51cf87725d68aaf4457b88828986a40dc', items: this.moreMenuItems }), h("kritzel-share-dialog", { key: 'f5840e7f56cf6897ec28b0f28d9b204037bf3348', ref: el => (this.shareDialogRef = el), isPublic: this.currentIsPublic, workspaceId: this.activeWorkspace?.id, onToggleIsPublic: this.handleToggleIsPublic }), this.loginConfig && (h("kritzel-login-dialog", { key: 'cfdcc3d5e7a5e29b0a352f0d4423ae79195dbf69', ref: el => (this.loginDialogRef = el), providers: this.loginConfig.providers, dialogTitle: this.loginConfig.title, subtitle: this.loginConfig.subtitle, onProviderLogin: this.handleProviderLogin })))));
|
|
706
710
|
}
|
|
707
711
|
static get is() { return "kritzel-editor"; }
|
|
708
712
|
static get originalStyleUrls() {
|
|
@@ -924,8 +928,7 @@ export class KritzelEditor {
|
|
|
924
928
|
"text": ""
|
|
925
929
|
},
|
|
926
930
|
"getter": false,
|
|
927
|
-
"setter": false
|
|
928
|
-
"defaultValue": "{\r\n id: `guest-1`,\r\n displayName: 'Guest',\r\n isGuest: false,\r\n }"
|
|
931
|
+
"setter": false
|
|
929
932
|
},
|
|
930
933
|
"activeUsers": {
|
|
931
934
|
"type": "unknown",
|
|
@@ -1136,7 +1139,8 @@ export class KritzelEditor {
|
|
|
1136
1139
|
"text": "Optional login configuration. When provided, a \"Sign in\" button is shown that opens a login dialog with the configured providers."
|
|
1137
1140
|
},
|
|
1138
1141
|
"getter": false,
|
|
1139
|
-
"setter": false
|
|
1142
|
+
"setter": false,
|
|
1143
|
+
"defaultValue": "{\r\n providers: [\r\n {\r\n label: 'Sign in with Google',\r\n icon: 'google',\r\n name: 'Google',\r\n }\r\n ]\r\n }"
|
|
1140
1144
|
},
|
|
1141
1145
|
"editorId": {
|
|
1142
1146
|
"type": "string",
|
|
@@ -22,6 +22,27 @@ p, h1, h2, h3, h4, h5, h6, blockquote, pre {
|
|
|
22
22
|
padding: 0;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
.workspace-loading-overlay {
|
|
26
|
+
position: absolute;
|
|
27
|
+
inset: 0;
|
|
28
|
+
z-index: 9999;
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
background-color: var(--kritzel-loading-overlay-background, rgba(255, 255, 255, 0.6));
|
|
33
|
+
color: var(--kritzel-loading-overlay-color, #333);
|
|
34
|
+
font-size: 1.25rem;
|
|
35
|
+
pointer-events: all;
|
|
36
|
+
animation: workspace-loading-fade-in var(--kritzel-loading-overlay-delay, 300ms) ease-out forwards;
|
|
37
|
+
opacity: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@keyframes workspace-loading-fade-in {
|
|
41
|
+
to {
|
|
42
|
+
opacity: 1;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
25
46
|
.debug-panel {
|
|
26
47
|
position: absolute;
|
|
27
48
|
pointer-events: none;
|