tinymce-solid 0.0.2 → 0.0.4

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.
@@ -1,6 +1,3 @@
1
- import { use, effect, setAttribute, template } from 'solid-js/web';
2
- import { createSignal, createEffect, on, onMount, onCleanup } from 'solid-js';
3
-
4
1
  var __create = Object.create;
5
2
  var __defProp = Object.defineProperty;
6
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -100,7 +97,7 @@ var require_react_is_development = __commonJS({
100
97
  var Portal = REACT_PORTAL_TYPE;
101
98
  var Profiler = REACT_PROFILER_TYPE;
102
99
  var StrictMode = REACT_STRICT_MODE_TYPE;
103
- var Suspense = REACT_SUSPENSE_TYPE;
100
+ var Suspense2 = REACT_SUSPENSE_TYPE;
104
101
  var hasWarnedAboutDeprecatedIsAsyncMode = false;
105
102
  function isAsyncMode(object2) {
106
103
  {
@@ -159,7 +156,7 @@ var require_react_is_development = __commonJS({
159
156
  exports.Portal = Portal;
160
157
  exports.Profiler = Profiler;
161
158
  exports.StrictMode = StrictMode;
162
- exports.Suspense = Suspense;
159
+ exports.Suspense = Suspense2;
163
160
  exports.isAsyncMode = isAsyncMode;
164
161
  exports.isConcurrentMode = isConcurrentMode;
165
162
  exports.isContextConsumer = isContextConsumer;
@@ -793,6 +790,581 @@ var require_prop_types = __commonJS({
793
790
  }
794
791
  });
795
792
 
793
+ // node_modules/solid-js/dist/solid.js
794
+ var sharedConfig = {
795
+ context: void 0,
796
+ registry: void 0
797
+ };
798
+ function setHydrateContext(context) {
799
+ sharedConfig.context = context;
800
+ }
801
+ var equalFn = (a, b) => a === b;
802
+ var signalOptions = {
803
+ equals: equalFn
804
+ };
805
+ var ERROR = null;
806
+ var runEffects = runQueue;
807
+ var STALE = 1;
808
+ var PENDING = 2;
809
+ var UNOWNED = {
810
+ owned: null,
811
+ cleanups: null,
812
+ context: null,
813
+ owner: null
814
+ };
815
+ var Owner = null;
816
+ var Transition = null;
817
+ var Scheduler = null;
818
+ var ExternalSourceConfig = null;
819
+ var Listener = null;
820
+ var Updates = null;
821
+ var Effects = null;
822
+ var ExecCount = 0;
823
+ function createSignal(value, options) {
824
+ options = options ? Object.assign({}, signalOptions, options) : signalOptions;
825
+ const s = {
826
+ value,
827
+ observers: null,
828
+ observerSlots: null,
829
+ comparator: options.equals || void 0
830
+ };
831
+ const setter = (value2) => {
832
+ if (typeof value2 === "function") {
833
+ if (Transition && Transition.running && Transition.sources.has(s)) value2 = value2(s.tValue);
834
+ else value2 = value2(s.value);
835
+ }
836
+ return writeSignal(s, value2);
837
+ };
838
+ return [readSignal.bind(s), setter];
839
+ }
840
+ function createRenderEffect(fn, value, options) {
841
+ const c = createComputation(fn, value, false, STALE);
842
+ if (Scheduler && Transition && Transition.running) Updates.push(c);
843
+ else updateComputation(c);
844
+ }
845
+ function createEffect(fn, value, options) {
846
+ runEffects = runUserEffects;
847
+ const c = createComputation(fn, value, false, STALE), s = SuspenseContext && useContext(SuspenseContext);
848
+ if (s) c.suspense = s;
849
+ c.user = true;
850
+ Effects ? Effects.push(c) : updateComputation(c);
851
+ }
852
+ function untrack(fn) {
853
+ if (!ExternalSourceConfig && Listener === null) return fn();
854
+ const listener = Listener;
855
+ Listener = null;
856
+ try {
857
+ if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);
858
+ return fn();
859
+ } finally {
860
+ Listener = listener;
861
+ }
862
+ }
863
+ function on(deps, fn, options) {
864
+ const isArray = Array.isArray(deps);
865
+ let prevInput;
866
+ return (prevValue) => {
867
+ let input;
868
+ if (isArray) {
869
+ input = Array(deps.length);
870
+ for (let i = 0; i < deps.length; i++) input[i] = deps[i]();
871
+ } else input = deps();
872
+ const result = untrack(() => fn(input, prevInput, prevValue));
873
+ prevInput = input;
874
+ return result;
875
+ };
876
+ }
877
+ function onMount(fn) {
878
+ createEffect(() => untrack(fn));
879
+ }
880
+ function onCleanup(fn) {
881
+ if (Owner === null) ;
882
+ else if (Owner.cleanups === null) Owner.cleanups = [fn];
883
+ else Owner.cleanups.push(fn);
884
+ return fn;
885
+ }
886
+ function startTransition(fn) {
887
+ if (Transition && Transition.running) {
888
+ fn();
889
+ return Transition.done;
890
+ }
891
+ const l = Listener;
892
+ const o = Owner;
893
+ return Promise.resolve().then(() => {
894
+ Listener = l;
895
+ Owner = o;
896
+ let t;
897
+ if (Scheduler || SuspenseContext) {
898
+ t = Transition || (Transition = {
899
+ sources: /* @__PURE__ */ new Set(),
900
+ effects: [],
901
+ promises: /* @__PURE__ */ new Set(),
902
+ disposed: /* @__PURE__ */ new Set(),
903
+ queue: /* @__PURE__ */ new Set(),
904
+ running: true
905
+ });
906
+ t.done || (t.done = new Promise((res) => t.resolve = res));
907
+ t.running = true;
908
+ }
909
+ runUpdates(fn);
910
+ Listener = Owner = null;
911
+ return t ? t.done : void 0;
912
+ });
913
+ }
914
+ var [transPending, setTransPending] = /* @__PURE__ */ createSignal(false);
915
+ function useContext(context) {
916
+ return Owner && Owner.context && Owner.context[context.id] !== void 0 ? Owner.context[context.id] : context.defaultValue;
917
+ }
918
+ var SuspenseContext;
919
+ function readSignal() {
920
+ const runningTransition = Transition && Transition.running;
921
+ if (this.sources && (runningTransition ? this.tState : this.state)) {
922
+ if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);
923
+ else {
924
+ const updates = Updates;
925
+ Updates = null;
926
+ runUpdates(() => lookUpstream(this));
927
+ Updates = updates;
928
+ }
929
+ }
930
+ if (Listener) {
931
+ const sSlot = this.observers ? this.observers.length : 0;
932
+ if (!Listener.sources) {
933
+ Listener.sources = [this];
934
+ Listener.sourceSlots = [sSlot];
935
+ } else {
936
+ Listener.sources.push(this);
937
+ Listener.sourceSlots.push(sSlot);
938
+ }
939
+ if (!this.observers) {
940
+ this.observers = [Listener];
941
+ this.observerSlots = [Listener.sources.length - 1];
942
+ } else {
943
+ this.observers.push(Listener);
944
+ this.observerSlots.push(Listener.sources.length - 1);
945
+ }
946
+ }
947
+ if (runningTransition && Transition.sources.has(this)) return this.tValue;
948
+ return this.value;
949
+ }
950
+ function writeSignal(node, value, isComp) {
951
+ let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
952
+ if (!node.comparator || !node.comparator(current, value)) {
953
+ if (Transition) {
954
+ const TransitionRunning = Transition.running;
955
+ if (TransitionRunning || !isComp && Transition.sources.has(node)) {
956
+ Transition.sources.add(node);
957
+ node.tValue = value;
958
+ }
959
+ if (!TransitionRunning) node.value = value;
960
+ } else node.value = value;
961
+ if (node.observers && node.observers.length) {
962
+ runUpdates(() => {
963
+ for (let i = 0; i < node.observers.length; i += 1) {
964
+ const o = node.observers[i];
965
+ const TransitionRunning = Transition && Transition.running;
966
+ if (TransitionRunning && Transition.disposed.has(o)) continue;
967
+ if (TransitionRunning ? !o.tState : !o.state) {
968
+ if (o.pure) Updates.push(o);
969
+ else Effects.push(o);
970
+ if (o.observers) markDownstream(o);
971
+ }
972
+ if (!TransitionRunning) o.state = STALE;
973
+ else o.tState = STALE;
974
+ }
975
+ if (Updates.length > 1e6) {
976
+ Updates = [];
977
+ if (false) ;
978
+ throw new Error();
979
+ }
980
+ });
981
+ }
982
+ }
983
+ return value;
984
+ }
985
+ function updateComputation(node) {
986
+ if (!node.fn) return;
987
+ cleanNode(node);
988
+ const time = ExecCount;
989
+ runComputation(
990
+ node,
991
+ Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
992
+ time
993
+ );
994
+ if (Transition && !Transition.running && Transition.sources.has(node)) {
995
+ queueMicrotask(() => {
996
+ runUpdates(() => {
997
+ Transition && (Transition.running = true);
998
+ Listener = Owner = node;
999
+ runComputation(node, node.tValue, time);
1000
+ Listener = Owner = null;
1001
+ });
1002
+ });
1003
+ }
1004
+ }
1005
+ function runComputation(node, value, time) {
1006
+ let nextValue;
1007
+ const owner = Owner, listener = Listener;
1008
+ Listener = Owner = node;
1009
+ try {
1010
+ nextValue = node.fn(value);
1011
+ } catch (err) {
1012
+ if (node.pure) {
1013
+ if (Transition && Transition.running) {
1014
+ node.tState = STALE;
1015
+ node.tOwned && node.tOwned.forEach(cleanNode);
1016
+ node.tOwned = void 0;
1017
+ } else {
1018
+ node.state = STALE;
1019
+ node.owned && node.owned.forEach(cleanNode);
1020
+ node.owned = null;
1021
+ }
1022
+ }
1023
+ node.updatedAt = time + 1;
1024
+ return handleError(err);
1025
+ } finally {
1026
+ Listener = listener;
1027
+ Owner = owner;
1028
+ }
1029
+ if (!node.updatedAt || node.updatedAt <= time) {
1030
+ if (node.updatedAt != null && "observers" in node) {
1031
+ writeSignal(node, nextValue, true);
1032
+ } else if (Transition && Transition.running && node.pure) {
1033
+ Transition.sources.add(node);
1034
+ node.tValue = nextValue;
1035
+ } else node.value = nextValue;
1036
+ node.updatedAt = time;
1037
+ }
1038
+ }
1039
+ function createComputation(fn, init, pure, state = STALE, options) {
1040
+ const c = {
1041
+ fn,
1042
+ state,
1043
+ updatedAt: null,
1044
+ owned: null,
1045
+ sources: null,
1046
+ sourceSlots: null,
1047
+ cleanups: null,
1048
+ value: init,
1049
+ owner: Owner,
1050
+ context: Owner ? Owner.context : null,
1051
+ pure
1052
+ };
1053
+ if (Transition && Transition.running) {
1054
+ c.state = 0;
1055
+ c.tState = state;
1056
+ }
1057
+ if (Owner === null) ;
1058
+ else if (Owner !== UNOWNED) {
1059
+ if (Transition && Transition.running && Owner.pure) {
1060
+ if (!Owner.tOwned) Owner.tOwned = [c];
1061
+ else Owner.tOwned.push(c);
1062
+ } else {
1063
+ if (!Owner.owned) Owner.owned = [c];
1064
+ else Owner.owned.push(c);
1065
+ }
1066
+ }
1067
+ if (ExternalSourceConfig && c.fn) {
1068
+ const [track, trigger] = createSignal(void 0, {
1069
+ equals: false
1070
+ });
1071
+ const ordinary = ExternalSourceConfig.factory(c.fn, trigger);
1072
+ onCleanup(() => ordinary.dispose());
1073
+ const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());
1074
+ const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);
1075
+ c.fn = (x) => {
1076
+ track();
1077
+ return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);
1078
+ };
1079
+ }
1080
+ return c;
1081
+ }
1082
+ function runTop(node) {
1083
+ const runningTransition = Transition && Transition.running;
1084
+ if ((runningTransition ? node.tState : node.state) === 0) return;
1085
+ if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);
1086
+ if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);
1087
+ const ancestors = [node];
1088
+ while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {
1089
+ if (runningTransition && Transition.disposed.has(node)) return;
1090
+ if (runningTransition ? node.tState : node.state) ancestors.push(node);
1091
+ }
1092
+ for (let i = ancestors.length - 1; i >= 0; i--) {
1093
+ node = ancestors[i];
1094
+ if (runningTransition) {
1095
+ let top = node, prev = ancestors[i + 1];
1096
+ while ((top = top.owner) && top !== prev) {
1097
+ if (Transition.disposed.has(top)) return;
1098
+ }
1099
+ }
1100
+ if ((runningTransition ? node.tState : node.state) === STALE) {
1101
+ updateComputation(node);
1102
+ } else if ((runningTransition ? node.tState : node.state) === PENDING) {
1103
+ const updates = Updates;
1104
+ Updates = null;
1105
+ runUpdates(() => lookUpstream(node, ancestors[0]));
1106
+ Updates = updates;
1107
+ }
1108
+ }
1109
+ }
1110
+ function runUpdates(fn, init) {
1111
+ if (Updates) return fn();
1112
+ let wait = false;
1113
+ Updates = [];
1114
+ if (Effects) wait = true;
1115
+ else Effects = [];
1116
+ ExecCount++;
1117
+ try {
1118
+ const res = fn();
1119
+ completeUpdates(wait);
1120
+ return res;
1121
+ } catch (err) {
1122
+ if (!wait) Effects = null;
1123
+ Updates = null;
1124
+ handleError(err);
1125
+ }
1126
+ }
1127
+ function completeUpdates(wait) {
1128
+ if (Updates) {
1129
+ if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);
1130
+ else runQueue(Updates);
1131
+ Updates = null;
1132
+ }
1133
+ if (wait) return;
1134
+ let res;
1135
+ if (Transition) {
1136
+ if (!Transition.promises.size && !Transition.queue.size) {
1137
+ const sources = Transition.sources;
1138
+ const disposed = Transition.disposed;
1139
+ Effects.push.apply(Effects, Transition.effects);
1140
+ res = Transition.resolve;
1141
+ for (const e2 of Effects) {
1142
+ "tState" in e2 && (e2.state = e2.tState);
1143
+ delete e2.tState;
1144
+ }
1145
+ Transition = null;
1146
+ runUpdates(() => {
1147
+ for (const d of disposed) cleanNode(d);
1148
+ for (const v of sources) {
1149
+ v.value = v.tValue;
1150
+ if (v.owned) {
1151
+ for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);
1152
+ }
1153
+ if (v.tOwned) v.owned = v.tOwned;
1154
+ delete v.tValue;
1155
+ delete v.tOwned;
1156
+ v.tState = 0;
1157
+ }
1158
+ setTransPending(false);
1159
+ });
1160
+ } else if (Transition.running) {
1161
+ Transition.running = false;
1162
+ Transition.effects.push.apply(Transition.effects, Effects);
1163
+ Effects = null;
1164
+ setTransPending(true);
1165
+ return;
1166
+ }
1167
+ }
1168
+ const e = Effects;
1169
+ Effects = null;
1170
+ if (e.length) runUpdates(() => runEffects(e));
1171
+ if (res) res();
1172
+ }
1173
+ function runQueue(queue) {
1174
+ for (let i = 0; i < queue.length; i++) runTop(queue[i]);
1175
+ }
1176
+ function scheduleQueue(queue) {
1177
+ for (let i = 0; i < queue.length; i++) {
1178
+ const item = queue[i];
1179
+ const tasks = Transition.queue;
1180
+ if (!tasks.has(item)) {
1181
+ tasks.add(item);
1182
+ Scheduler(() => {
1183
+ tasks.delete(item);
1184
+ runUpdates(() => {
1185
+ Transition.running = true;
1186
+ runTop(item);
1187
+ });
1188
+ Transition && (Transition.running = false);
1189
+ });
1190
+ }
1191
+ }
1192
+ }
1193
+ function runUserEffects(queue) {
1194
+ let i, userLength = 0;
1195
+ for (i = 0; i < queue.length; i++) {
1196
+ const e = queue[i];
1197
+ if (!e.user) runTop(e);
1198
+ else queue[userLength++] = e;
1199
+ }
1200
+ if (sharedConfig.context) {
1201
+ if (sharedConfig.count) {
1202
+ sharedConfig.effects || (sharedConfig.effects = []);
1203
+ sharedConfig.effects.push(...queue.slice(0, userLength));
1204
+ return;
1205
+ } else if (sharedConfig.effects) {
1206
+ queue = [...sharedConfig.effects, ...queue];
1207
+ userLength += sharedConfig.effects.length;
1208
+ delete sharedConfig.effects;
1209
+ }
1210
+ setHydrateContext();
1211
+ }
1212
+ for (i = 0; i < userLength; i++) runTop(queue[i]);
1213
+ }
1214
+ function lookUpstream(node, ignore) {
1215
+ const runningTransition = Transition && Transition.running;
1216
+ if (runningTransition) node.tState = 0;
1217
+ else node.state = 0;
1218
+ for (let i = 0; i < node.sources.length; i += 1) {
1219
+ const source = node.sources[i];
1220
+ if (source.sources) {
1221
+ const state = runningTransition ? source.tState : source.state;
1222
+ if (state === STALE) {
1223
+ if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
1224
+ runTop(source);
1225
+ } else if (state === PENDING) lookUpstream(source, ignore);
1226
+ }
1227
+ }
1228
+ }
1229
+ function markDownstream(node) {
1230
+ const runningTransition = Transition && Transition.running;
1231
+ for (let i = 0; i < node.observers.length; i += 1) {
1232
+ const o = node.observers[i];
1233
+ if (runningTransition ? !o.tState : !o.state) {
1234
+ if (runningTransition) o.tState = PENDING;
1235
+ else o.state = PENDING;
1236
+ if (o.pure) Updates.push(o);
1237
+ else Effects.push(o);
1238
+ o.observers && markDownstream(o);
1239
+ }
1240
+ }
1241
+ }
1242
+ function cleanNode(node) {
1243
+ let i;
1244
+ if (node.sources) {
1245
+ while (node.sources.length) {
1246
+ const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;
1247
+ if (obs && obs.length) {
1248
+ const n = obs.pop(), s = source.observerSlots.pop();
1249
+ if (index < obs.length) {
1250
+ n.sourceSlots[s] = index;
1251
+ obs[index] = n;
1252
+ source.observerSlots[index] = s;
1253
+ }
1254
+ }
1255
+ }
1256
+ }
1257
+ if (Transition && Transition.running && node.pure) {
1258
+ if (node.tOwned) {
1259
+ for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);
1260
+ delete node.tOwned;
1261
+ }
1262
+ reset(node, true);
1263
+ } else if (node.owned) {
1264
+ for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);
1265
+ node.owned = null;
1266
+ }
1267
+ if (node.cleanups) {
1268
+ for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
1269
+ node.cleanups = null;
1270
+ }
1271
+ if (Transition && Transition.running) node.tState = 0;
1272
+ else node.state = 0;
1273
+ }
1274
+ function reset(node, top) {
1275
+ if (!top) {
1276
+ node.tState = 0;
1277
+ Transition.disposed.add(node);
1278
+ }
1279
+ if (node.owned) {
1280
+ for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);
1281
+ }
1282
+ }
1283
+ function castError(err) {
1284
+ if (err instanceof Error) return err;
1285
+ return new Error(typeof err === "string" ? err : "Unknown error", {
1286
+ cause: err
1287
+ });
1288
+ }
1289
+ function runErrors(err, fns, owner) {
1290
+ try {
1291
+ for (const f of fns) f(err);
1292
+ } catch (e) {
1293
+ handleError(e, owner && owner.owner || null);
1294
+ }
1295
+ }
1296
+ function handleError(err, owner = Owner) {
1297
+ const fns = ERROR && owner && owner.context && owner.context[ERROR];
1298
+ const error = castError(err);
1299
+ if (!fns) throw error;
1300
+ if (Effects)
1301
+ Effects.push({
1302
+ fn() {
1303
+ runErrors(error, fns, owner);
1304
+ },
1305
+ state: STALE
1306
+ });
1307
+ else runErrors(error, fns, owner);
1308
+ }
1309
+
1310
+ // node_modules/solid-js/web/dist/web.js
1311
+ var booleans = [
1312
+ "allowfullscreen",
1313
+ "async",
1314
+ "autofocus",
1315
+ "autoplay",
1316
+ "checked",
1317
+ "controls",
1318
+ "default",
1319
+ "disabled",
1320
+ "formnovalidate",
1321
+ "hidden",
1322
+ "indeterminate",
1323
+ "inert",
1324
+ "ismap",
1325
+ "loop",
1326
+ "multiple",
1327
+ "muted",
1328
+ "nomodule",
1329
+ "novalidate",
1330
+ "open",
1331
+ "playsinline",
1332
+ "readonly",
1333
+ "required",
1334
+ "reversed",
1335
+ "seamless",
1336
+ "selected"
1337
+ ];
1338
+ /* @__PURE__ */ new Set([
1339
+ "className",
1340
+ "value",
1341
+ "readOnly",
1342
+ "formNoValidate",
1343
+ "isMap",
1344
+ "noModule",
1345
+ "playsInline",
1346
+ ...booleans
1347
+ ]);
1348
+ function template(html, isCE, isSVG) {
1349
+ let node;
1350
+ const create = () => {
1351
+ const t = document.createElement("template");
1352
+ t.innerHTML = html;
1353
+ return t.content.firstChild;
1354
+ };
1355
+ const fn = () => (node || (node = create())).cloneNode(true);
1356
+ fn.cloneNode = fn;
1357
+ return fn;
1358
+ }
1359
+ function setAttribute(node, name, value) {
1360
+ if (!!sharedConfig.context && node.isConnected) return;
1361
+ if (value == null) node.removeAttribute(name);
1362
+ else node.setAttribute(name, value);
1363
+ }
1364
+ function use(fn, element, arg) {
1365
+ return untrack(() => fn(element, arg));
1366
+ }
1367
+
796
1368
  // src/components/EditorPropTypes.ts
797
1369
  var PropTypes = __toESM(require_prop_types(), 1);
798
1370
  var eventPropTypes = {
@@ -1115,6 +1687,7 @@ var SolidEditor = (props) => {
1115
1687
  const value = () => props.value || "";
1116
1688
  const skin = () => props.skin || "oxide";
1117
1689
  const contentCss = () => props.contentCss || "default";
1690
+ const disabled = () => props.disabled || false;
1118
1691
  const [editor, setEditor] = createSignal();
1119
1692
  const [currentContent, setCurrentContent] = createSignal(value());
1120
1693
  const [rollbackTimer, setRollbackTimer] = createSignal();
@@ -1184,6 +1757,13 @@ var SolidEditor = (props) => {
1184
1757
  }
1185
1758
  }
1186
1759
  };
1760
+ const successHandler = () => {
1761
+ props.onScriptsLoad?.();
1762
+ initialise();
1763
+ };
1764
+ const errorHandler = (err) => {
1765
+ props.onScriptsLoadError?.(err);
1766
+ };
1187
1767
  const initialise = (attempts = 0) => {
1188
1768
  const target = props.elementRef;
1189
1769
  if (!target) {
@@ -1242,8 +1822,8 @@ var SolidEditor = (props) => {
1242
1822
  editor2.setDirty(false);
1243
1823
  }
1244
1824
  setCurrentContent(newCurrentValue);
1245
- const disabled = props.disabled ?? false;
1246
- setMode(editor2, disabled ? "readonly" : "design");
1825
+ const isDisabled = disabled() ?? false;
1826
+ setMode(editor2, isDisabled ? "readonly" : "design");
1247
1827
  if (props.init && isFunction(props.init.init_instance_callback)) {
1248
1828
  props.init.init_instance_callback(editor2);
1249
1829
  }
@@ -1261,14 +1841,8 @@ var SolidEditor = (props) => {
1261
1841
  if (getTinymce(view()) !== null) {
1262
1842
  initialise();
1263
1843
  } else if (Array.isArray(props.tinymceScriptSrc) && props.tinymceScriptSrc.length === 0) {
1264
- throw new Error("No `tinymce` global is present but the `tinymceScriptSrc` prop was an empty array.");
1844
+ props.onScriptsLoadError?.(new Error("No `tinymce` global is present but the `tinymceScriptSrc` prop was an empty array."));
1265
1845
  } else if (props?.elementRef?.ownerDocument) {
1266
- const successHandler = () => {
1267
- initialise();
1268
- };
1269
- const errorHandler = (err) => {
1270
- throw new Error(err);
1271
- };
1272
1846
  ScriptLoader.loadList(props.elementRef.ownerDocument, getScriptSources(), props.scriptLoading?.delay ?? 0, successHandler, errorHandler);
1273
1847
  }
1274
1848
  };
@@ -1300,9 +1874,14 @@ var SolidEditor = (props) => {
1300
1874
  }));
1301
1875
  createEffect(on(skin, () => {
1302
1876
  cleanUpCallback();
1303
- setTimeout(() => {
1304
- mountCallback();
1305
- }, 34);
1877
+ setTimeout(mountCallback, 1);
1878
+ }));
1879
+ createEffect(on(disabled, () => {
1880
+ const tinyEditor = editor();
1881
+ if (tinyEditor?.initialized) {
1882
+ const isDisabled = disabled() ?? false;
1883
+ setMode(tinyEditor, isDisabled ? "readonly" : "design");
1884
+ }
1306
1885
  }));
1307
1886
  onMount(mountCallback);
1308
1887
  onCleanup(cleanUpCallback);
@@ -1371,36 +1950,34 @@ var SolidEditor = (props) => {
1371
1950
  var _el$ = _tmpl$();
1372
1951
  var _ref$ = props.elementRef;
1373
1952
  typeof _ref$ === "function" ? use(_ref$, _el$) : props.elementRef = _el$;
1374
- effect((_p$) => {
1375
- var _v$ = editor() ? "" : "none", _v$2 = id(), _v$3 = props.testid, _v$4 = props.tabIndex;
1376
- _v$ !== _p$.e && ((_p$.e = _v$) != null ? _el$.style.setProperty("display", _v$) : _el$.style.removeProperty("display"));
1377
- _v$2 !== _p$.t && setAttribute(_el$, "id", _p$.t = _v$2);
1378
- _v$3 !== _p$.a && setAttribute(_el$, "data-testid", _p$.a = _v$3);
1379
- _v$4 !== _p$.o && setAttribute(_el$, "tabindex", _p$.o = _v$4);
1953
+ _el$.style.setProperty("visibility", "hidden");
1954
+ createRenderEffect((_p$) => {
1955
+ var _v$ = id(), _v$2 = props.testid, _v$3 = props.tabIndex;
1956
+ _v$ !== _p$.e && setAttribute(_el$, "id", _p$.e = _v$);
1957
+ _v$2 !== _p$.t && setAttribute(_el$, "data-testid", _p$.t = _v$2);
1958
+ _v$3 !== _p$.a && setAttribute(_el$, "tabindex", _p$.a = _v$3);
1380
1959
  return _p$;
1381
1960
  }, {
1382
1961
  e: void 0,
1383
1962
  t: void 0,
1384
- a: void 0,
1385
- o: void 0
1963
+ a: void 0
1386
1964
  });
1387
1965
  return _el$;
1388
1966
  })() : (() => {
1389
1967
  var _el$2 = _tmpl$2();
1390
1968
  var _ref$2 = props.elementRef;
1391
1969
  typeof _ref$2 === "function" ? use(_ref$2, _el$2) : props.elementRef = _el$2;
1392
- effect((_p$) => {
1393
- var _v$5 = editor() ? "" : "none", _v$6 = id(), _v$7 = props.testid, _v$8 = props.tabIndex;
1394
- _v$5 !== _p$.e && ((_p$.e = _v$5) != null ? _el$2.style.setProperty("display", _v$5) : _el$2.style.removeProperty("display"));
1395
- _v$6 !== _p$.t && setAttribute(_el$2, "id", _p$.t = _v$6);
1396
- _v$7 !== _p$.a && setAttribute(_el$2, "data-testid", _p$.a = _v$7);
1397
- _v$8 !== _p$.o && setAttribute(_el$2, "tabindex", _p$.o = _v$8);
1970
+ _el$2.style.setProperty("visibility", "hidden");
1971
+ createRenderEffect((_p$) => {
1972
+ var _v$4 = id(), _v$5 = props.testid, _v$6 = props.tabIndex;
1973
+ _v$4 !== _p$.e && setAttribute(_el$2, "id", _p$.e = _v$4);
1974
+ _v$5 !== _p$.t && setAttribute(_el$2, "data-testid", _p$.t = _v$5);
1975
+ _v$6 !== _p$.a && setAttribute(_el$2, "tabindex", _p$.a = _v$6);
1398
1976
  return _p$;
1399
1977
  }, {
1400
1978
  e: void 0,
1401
1979
  t: void 0,
1402
- a: void 0,
1403
- o: void 0
1980
+ a: void 0
1404
1981
  });
1405
1982
  return _el$2;
1406
1983
  })();