studiokit-scaffolding-js 4.5.3 → 4.5.6-alpha.2
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/lib/components/Quill/Formats/Image.d.ts +1 -1
- package/lib/components/Quill/Formats/Image.js +7 -3
- package/lib/components/Quill/TableModule/Blots/TableCellBlot.js +10 -0
- package/lib/components/Quill/TableModule/index.js +8 -0
- package/lib/components/Quill/TableModule/utils.js +1 -1
- package/lib/css/variables.css +1 -1
- package/lib/redux/configureStore.d.ts +3 -1
- package/lib/redux/configureStore.js +27 -23
- package/package.json +1 -1
|
@@ -62,8 +62,12 @@ var Image = /** @class */ (function (_super) {
|
|
|
62
62
|
Image.create = function (value) {
|
|
63
63
|
var _a, _b, _c;
|
|
64
64
|
var node = _super.create.call(this, this.tagName);
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
if ((_a = value.alt) === null || _a === void 0 ? void 0 : _a.trim()) {
|
|
66
|
+
node.setAttribute('alt', value.alt);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
node.className = 'alt-text-missing';
|
|
70
|
+
}
|
|
67
71
|
node.setAttribute('src', value.src);
|
|
68
72
|
// Setting up the height and width to be reactive when an image is getting resize
|
|
69
73
|
node.setAttribute('height', (_b = value.height) !== null && _b !== void 0 ? _b : 'auto');
|
|
@@ -75,7 +79,7 @@ var Image = /** @class */ (function (_super) {
|
|
|
75
79
|
return {
|
|
76
80
|
width: node.getAttribute('width'),
|
|
77
81
|
height: node.getAttribute('height'),
|
|
78
|
-
alt: node.getAttribute('alt'),
|
|
82
|
+
alt: node.getAttribute('alt') || undefined,
|
|
79
83
|
src: node.getAttribute('src')
|
|
80
84
|
};
|
|
81
85
|
};
|
|
@@ -117,6 +117,16 @@ var TableCellBlot = /** @class */ (function (_super) {
|
|
|
117
117
|
child: child,
|
|
118
118
|
ref: refNode
|
|
119
119
|
});
|
|
120
|
+
if (child instanceof TableCellBlot) {
|
|
121
|
+
logger_1.getLogger().debug(this.statics.tagName + " insertBefore: inserting cells, copy contents", {
|
|
122
|
+
this: this,
|
|
123
|
+
child: child,
|
|
124
|
+
ref: refNode
|
|
125
|
+
});
|
|
126
|
+
child.moveChildren(this, refNode);
|
|
127
|
+
child.remove();
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
120
130
|
if (this.statics.allowedChildren != null &&
|
|
121
131
|
!this.statics.allowedChildren.some(function (allowedChild) {
|
|
122
132
|
return child instanceof allowedChild;
|
|
@@ -144,6 +144,10 @@ var TableModule = /** @class */ (function () {
|
|
|
144
144
|
// Override "backspace" and "delete" actions that would delete or combine a table cell
|
|
145
145
|
var keyboard = quill.getModule('keyboard');
|
|
146
146
|
if (keyboard) {
|
|
147
|
+
keyboard.addBinding({ key: constants_1.KEY.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, this.handleBackspace);
|
|
148
|
+
// move binding to first position
|
|
149
|
+
var backspaceOtherBinding = keyboard.bindings[constants_1.KEY.BACKSPACE].pop();
|
|
150
|
+
keyboard.bindings[constants_1.KEY.BACKSPACE].splice(0, 0, backspaceOtherBinding);
|
|
147
151
|
keyboard.addBinding({ key: constants_1.KEY.BACKSPACE }, { collapsed: false }, this.handleDeleteRange);
|
|
148
152
|
// move binding to first position
|
|
149
153
|
var backspaceRangeBinding = keyboard.bindings[constants_1.KEY.BACKSPACE].pop();
|
|
@@ -156,6 +160,10 @@ var TableModule = /** @class */ (function () {
|
|
|
156
160
|
// move binding to first position
|
|
157
161
|
var deleteRangeBinding = keyboard.bindings[constants_1.KEY.DELETE].pop();
|
|
158
162
|
keyboard.bindings[constants_1.KEY.DELETE].splice(0, 0, deleteRangeBinding);
|
|
163
|
+
keyboard.addBinding({ key: constants_1.KEY.DELETE }, { collapsed: true, altKey: true }, this.handleDelete);
|
|
164
|
+
// move binding to first position
|
|
165
|
+
var deleteWithAltBinding = keyboard.bindings[constants_1.KEY.DELETE].pop();
|
|
166
|
+
keyboard.bindings[constants_1.KEY.DELETE].splice(0, 0, deleteWithAltBinding);
|
|
159
167
|
keyboard.addBinding({ key: constants_1.KEY.DELETE }, { collapsed: true }, this.handleDelete);
|
|
160
168
|
// move binding to first position
|
|
161
169
|
var deleteBinding = keyboard.bindings[constants_1.KEY.DELETE].pop();
|
|
@@ -12,7 +12,7 @@ var isLineBeforeTable = function (line) {
|
|
|
12
12
|
};
|
|
13
13
|
exports.isLineBeforeTable = isLineBeforeTable;
|
|
14
14
|
var isLineAfterTable = function (line) {
|
|
15
|
-
return line.prev && exports.isInstanceOfBlot(line.
|
|
15
|
+
return line.prev && exports.isInstanceOfBlot(line.prev, constants_1.TABLE_BLOT_NAME.TABLE_CONTAINER);
|
|
16
16
|
};
|
|
17
17
|
exports.isLineAfterTable = isLineAfterTable;
|
|
18
18
|
var rangeRemovalWillDeleteCellWithoutRow = function (quill, range) {
|
package/lib/css/variables.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { History } from 'history';
|
|
2
|
-
import { Store } from 'redux';
|
|
2
|
+
import { AnyAction, Store } from 'redux';
|
|
3
3
|
import { Persistor, PersistState } from 'redux-persist';
|
|
4
4
|
import { BaseReduxState } from '../types';
|
|
5
5
|
export declare type CustomStore<TReduxState extends BaseReduxState> = Store<TReduxState & {
|
|
@@ -7,6 +7,8 @@ export declare type CustomStore<TReduxState extends BaseReduxState> = Store<TRed
|
|
|
7
7
|
}, any> & {
|
|
8
8
|
dispatch: unknown;
|
|
9
9
|
};
|
|
10
|
+
export declare const stripState: (obj: any, parentKey?: any) => any;
|
|
11
|
+
export declare const actionTransformer: (action: AnyAction) => any;
|
|
10
12
|
declare const configureStore: <TReduxState extends BaseReduxState<import("../types").BaseModelsState<import("../types").Group, import("../types").BaseSearchModelsState<import("../types").Group>>>>(history: History<any>) => {
|
|
11
13
|
store: CustomStore<TReduxState>;
|
|
12
14
|
persistor: Persistor;
|
|
@@ -29,6 +29,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29
29
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
30
|
};
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.actionTransformer = exports.stripState = void 0;
|
|
32
33
|
var Sentry = __importStar(require("@sentry/react"));
|
|
33
34
|
var connected_react_router_1 = require("connected-react-router");
|
|
34
35
|
var lodash_1 = require("lodash");
|
|
@@ -43,49 +44,52 @@ var actionCreator_1 = require("./actionCreator");
|
|
|
43
44
|
var actions_1 = require("./actions");
|
|
44
45
|
var configureReducers_1 = __importDefault(require("./configureReducers"));
|
|
45
46
|
var rootSaga_1 = __importDefault(require("./sagas/rootSaga"));
|
|
46
|
-
var
|
|
47
|
-
var
|
|
47
|
+
var keysToFilter = ['puid', 'employeeNumber', 'access_token', 'refresh_token', 'password', 'Password', 'content'];
|
|
48
|
+
var filterData = function (obj) {
|
|
48
49
|
return lodash_1.transform(obj, function (result, value, key) {
|
|
49
|
-
if (
|
|
50
|
+
if (keysToFilter.includes(key)) {
|
|
50
51
|
result[key] = '[Filtered]';
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
53
|
-
result[key] = lodash_1.isPlainObject(value) ?
|
|
54
|
+
result[key] = lodash_1.isPlainObject(value) || lodash_1.isArray(value) ? filterData(value) : value;
|
|
54
55
|
});
|
|
55
56
|
};
|
|
56
57
|
var stripState = function (obj, parentKey) {
|
|
57
58
|
return lodash_1.transform(obj, function (result, value, key) {
|
|
58
|
-
if (lodash_1.isPlainObject(value)) {
|
|
59
|
-
result[key] = stripState(value, key);
|
|
59
|
+
if (lodash_1.isPlainObject(value) || lodash_1.isArray(value)) {
|
|
60
|
+
result[key] = exports.stripState(value, key);
|
|
60
61
|
}
|
|
61
62
|
else if (key === 'id' || parentKey === '_metadata') {
|
|
62
63
|
result[key] = value;
|
|
63
64
|
}
|
|
64
65
|
});
|
|
65
66
|
};
|
|
67
|
+
exports.stripState = stripState;
|
|
68
|
+
var actionTransformer = function (action) {
|
|
69
|
+
var _a;
|
|
70
|
+
// action breadcrumb filtering
|
|
71
|
+
if (
|
|
72
|
+
// do not track API responses
|
|
73
|
+
action.type === studiokit_net_js_1.NET_ACTION.FETCH_RESULT_RECEIVED ||
|
|
74
|
+
action.type === studiokit_net_js_1.NET_ACTION.TRANSIENT_FETCH_RESULT_RECEIVED ||
|
|
75
|
+
// do not track modal actions
|
|
76
|
+
action.type === actions_1.ACTION.MODAL_ENTERING ||
|
|
77
|
+
action.type === actions_1.ACTION.MODAL_EXITED ||
|
|
78
|
+
// do not track API requests for tokens
|
|
79
|
+
(action.type === studiokit_net_js_1.NET_ACTION.DATA_REQUESTED && ((_a = action.data) === null || _a === void 0 ? void 0 : _a.modelName) === 'getToken')) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
return filterData(action);
|
|
83
|
+
};
|
|
84
|
+
exports.actionTransformer = actionTransformer;
|
|
66
85
|
var configureStore = function (history) {
|
|
67
86
|
var appConfig = configuration_1.getAppConfig();
|
|
68
87
|
var sentryReduxEnhancer = Sentry.createReduxEnhancer({
|
|
69
88
|
stateTransformer: function (state) {
|
|
70
89
|
// Transform the state to remove unneeded data
|
|
71
|
-
return stripState(state);
|
|
90
|
+
return exports.stripState(state);
|
|
72
91
|
},
|
|
73
|
-
actionTransformer:
|
|
74
|
-
var _a;
|
|
75
|
-
// action breadcrumb filtering
|
|
76
|
-
if (
|
|
77
|
-
// do not track API responses
|
|
78
|
-
action.type === studiokit_net_js_1.NET_ACTION.FETCH_RESULT_RECEIVED ||
|
|
79
|
-
action.type === studiokit_net_js_1.NET_ACTION.TRANSIENT_FETCH_RESULT_RECEIVED ||
|
|
80
|
-
// do not track modal actions
|
|
81
|
-
action.type === actions_1.ACTION.MODAL_ENTERING ||
|
|
82
|
-
action.type === actions_1.ACTION.MODAL_EXITED ||
|
|
83
|
-
// do not track API requests for tokens
|
|
84
|
-
(action.type === studiokit_net_js_1.NET_ACTION.DATA_REQUESTED && ((_a = action.data) === null || _a === void 0 ? void 0 : _a.modelName) === 'getToken')) {
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
return stripSensitiveData(action);
|
|
88
|
-
}
|
|
92
|
+
actionTransformer: exports.actionTransformer
|
|
89
93
|
});
|
|
90
94
|
var sagaMiddleware = redux_saga_1.default();
|
|
91
95
|
var reduxRouterMiddleware = connected_react_router_1.routerMiddleware(history);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "studiokit-scaffolding-js",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.6-alpha.2",
|
|
4
4
|
"description": "Common scaffolding for Studio apps at Purdue",
|
|
5
5
|
"repository": "https://gitlab.com/purdue-informatics/studiokit/studiokit-scaffolding-js",
|
|
6
6
|
"license": "MIT",
|