tinymce-solid 0.0.4 → 0.0.6
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/README.md +15 -16
- package/banner.svg +98 -98
- package/dist/{dev.mjs → dev.js} +28 -618
- package/dist/dev.jsx +11 -595
- package/dist/index.d.ts +5 -5
- package/dist/{index.mjs → index.js} +26 -616
- package/dist/index.jsx +10 -13
- package/package.json +13 -13
- package/src/Utils.ts +1 -1
- package/src/components/{SolidEditor.tsx → Editor.tsx} +8 -13
- package/src/index.tsx +2 -2
package/dist/dev.jsx
CHANGED
|
@@ -803,589 +803,9 @@ var require_prop_types = __commonJS({
|
|
|
803
803
|
}
|
|
804
804
|
});
|
|
805
805
|
|
|
806
|
-
//
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
registry: void 0
|
|
810
|
-
};
|
|
811
|
-
function setHydrateContext(context) {
|
|
812
|
-
sharedConfig.context = context;
|
|
813
|
-
}
|
|
814
|
-
var equalFn = (a, b) => a === b;
|
|
815
|
-
var $PROXY = Symbol("solid-proxy");
|
|
816
|
-
var $TRACK = Symbol("solid-track");
|
|
817
|
-
var $DEVCOMP = Symbol("solid-dev-component");
|
|
818
|
-
var signalOptions = {
|
|
819
|
-
equals: equalFn
|
|
820
|
-
};
|
|
821
|
-
var ERROR = null;
|
|
822
|
-
var runEffects = runQueue;
|
|
823
|
-
var STALE = 1;
|
|
824
|
-
var PENDING = 2;
|
|
825
|
-
var UNOWNED = {
|
|
826
|
-
owned: null,
|
|
827
|
-
cleanups: null,
|
|
828
|
-
context: null,
|
|
829
|
-
owner: null
|
|
830
|
-
};
|
|
831
|
-
var Owner = null;
|
|
832
|
-
var Transition = null;
|
|
833
|
-
var Scheduler = null;
|
|
834
|
-
var ExternalSourceConfig = null;
|
|
835
|
-
var Listener = null;
|
|
836
|
-
var Updates = null;
|
|
837
|
-
var Effects = null;
|
|
838
|
-
var ExecCount = 0;
|
|
839
|
-
function createSignal(value, options) {
|
|
840
|
-
options = options ? Object.assign({}, signalOptions, options) : signalOptions;
|
|
841
|
-
const s = {
|
|
842
|
-
value,
|
|
843
|
-
observers: null,
|
|
844
|
-
observerSlots: null,
|
|
845
|
-
comparator: options.equals || void 0
|
|
846
|
-
};
|
|
847
|
-
const setter = (value2) => {
|
|
848
|
-
if (typeof value2 === "function") {
|
|
849
|
-
if (Transition && Transition.running && Transition.sources.has(s)) value2 = value2(s.tValue);
|
|
850
|
-
else value2 = value2(s.value);
|
|
851
|
-
}
|
|
852
|
-
return writeSignal(s, value2);
|
|
853
|
-
};
|
|
854
|
-
return [readSignal.bind(s), setter];
|
|
855
|
-
}
|
|
856
|
-
function createRenderEffect(fn, value, options) {
|
|
857
|
-
const c = createComputation(fn, value, false, STALE);
|
|
858
|
-
if (Scheduler && Transition && Transition.running) Updates.push(c);
|
|
859
|
-
else updateComputation(c);
|
|
860
|
-
}
|
|
861
|
-
function createEffect(fn, value, options) {
|
|
862
|
-
runEffects = runUserEffects;
|
|
863
|
-
const c = createComputation(fn, value, false, STALE), s = SuspenseContext && useContext(SuspenseContext);
|
|
864
|
-
if (s) c.suspense = s;
|
|
865
|
-
if (!options || !options.render) c.user = true;
|
|
866
|
-
Effects ? Effects.push(c) : updateComputation(c);
|
|
867
|
-
}
|
|
868
|
-
function createMemo(fn, value, options) {
|
|
869
|
-
options = options ? Object.assign({}, signalOptions, options) : signalOptions;
|
|
870
|
-
const c = createComputation(fn, value, true, 0);
|
|
871
|
-
c.observers = null;
|
|
872
|
-
c.observerSlots = null;
|
|
873
|
-
c.comparator = options.equals || void 0;
|
|
874
|
-
if (Scheduler && Transition && Transition.running) {
|
|
875
|
-
c.tState = STALE;
|
|
876
|
-
Updates.push(c);
|
|
877
|
-
} else updateComputation(c);
|
|
878
|
-
return readSignal.bind(c);
|
|
879
|
-
}
|
|
880
|
-
function untrack(fn) {
|
|
881
|
-
if (!ExternalSourceConfig && Listener === null) return fn();
|
|
882
|
-
const listener = Listener;
|
|
883
|
-
Listener = null;
|
|
884
|
-
try {
|
|
885
|
-
if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);
|
|
886
|
-
return fn();
|
|
887
|
-
} finally {
|
|
888
|
-
Listener = listener;
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
function on(deps, fn, options) {
|
|
892
|
-
const isArray = Array.isArray(deps);
|
|
893
|
-
let prevInput;
|
|
894
|
-
let defer = options && options.defer;
|
|
895
|
-
return (prevValue) => {
|
|
896
|
-
let input;
|
|
897
|
-
if (isArray) {
|
|
898
|
-
input = Array(deps.length);
|
|
899
|
-
for (let i = 0; i < deps.length; i++) input[i] = deps[i]();
|
|
900
|
-
} else input = deps();
|
|
901
|
-
if (defer) {
|
|
902
|
-
defer = false;
|
|
903
|
-
return prevValue;
|
|
904
|
-
}
|
|
905
|
-
const result = untrack(() => fn(input, prevInput, prevValue));
|
|
906
|
-
prevInput = input;
|
|
907
|
-
return result;
|
|
908
|
-
};
|
|
909
|
-
}
|
|
910
|
-
function onMount(fn) {
|
|
911
|
-
createEffect(() => untrack(fn));
|
|
912
|
-
}
|
|
913
|
-
function onCleanup(fn) {
|
|
914
|
-
if (Owner === null) ;
|
|
915
|
-
else if (Owner.cleanups === null) Owner.cleanups = [fn];
|
|
916
|
-
else Owner.cleanups.push(fn);
|
|
917
|
-
return fn;
|
|
918
|
-
}
|
|
919
|
-
function startTransition(fn) {
|
|
920
|
-
if (Transition && Transition.running) {
|
|
921
|
-
fn();
|
|
922
|
-
return Transition.done;
|
|
923
|
-
}
|
|
924
|
-
const l = Listener;
|
|
925
|
-
const o = Owner;
|
|
926
|
-
return Promise.resolve().then(() => {
|
|
927
|
-
Listener = l;
|
|
928
|
-
Owner = o;
|
|
929
|
-
let t;
|
|
930
|
-
if (Scheduler || SuspenseContext) {
|
|
931
|
-
t = Transition || (Transition = {
|
|
932
|
-
sources: /* @__PURE__ */ new Set(),
|
|
933
|
-
effects: [],
|
|
934
|
-
promises: /* @__PURE__ */ new Set(),
|
|
935
|
-
disposed: /* @__PURE__ */ new Set(),
|
|
936
|
-
queue: /* @__PURE__ */ new Set(),
|
|
937
|
-
running: true
|
|
938
|
-
});
|
|
939
|
-
t.done || (t.done = new Promise((res) => t.resolve = res));
|
|
940
|
-
t.running = true;
|
|
941
|
-
}
|
|
942
|
-
runUpdates(fn, false);
|
|
943
|
-
Listener = Owner = null;
|
|
944
|
-
return t ? t.done : void 0;
|
|
945
|
-
});
|
|
946
|
-
}
|
|
947
|
-
var [transPending, setTransPending] = /* @__PURE__ */ createSignal(false);
|
|
948
|
-
function createContext(defaultValue, options) {
|
|
949
|
-
const id = Symbol("context");
|
|
950
|
-
return {
|
|
951
|
-
id,
|
|
952
|
-
Provider: createProvider(id),
|
|
953
|
-
defaultValue
|
|
954
|
-
};
|
|
955
|
-
}
|
|
956
|
-
function useContext(context) {
|
|
957
|
-
return Owner && Owner.context && Owner.context[context.id] !== void 0 ? Owner.context[context.id] : context.defaultValue;
|
|
958
|
-
}
|
|
959
|
-
function children(fn) {
|
|
960
|
-
const children2 = createMemo(fn);
|
|
961
|
-
const memo = createMemo(() => resolveChildren(children2()));
|
|
962
|
-
memo.toArray = () => {
|
|
963
|
-
const c = memo();
|
|
964
|
-
return Array.isArray(c) ? c : c != null ? [c] : [];
|
|
965
|
-
};
|
|
966
|
-
return memo;
|
|
967
|
-
}
|
|
968
|
-
var SuspenseContext;
|
|
969
|
-
function readSignal() {
|
|
970
|
-
const runningTransition = Transition && Transition.running;
|
|
971
|
-
if (this.sources && (runningTransition ? this.tState : this.state)) {
|
|
972
|
-
if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);
|
|
973
|
-
else {
|
|
974
|
-
const updates = Updates;
|
|
975
|
-
Updates = null;
|
|
976
|
-
runUpdates(() => lookUpstream(this), false);
|
|
977
|
-
Updates = updates;
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
if (Listener) {
|
|
981
|
-
const sSlot = this.observers ? this.observers.length : 0;
|
|
982
|
-
if (!Listener.sources) {
|
|
983
|
-
Listener.sources = [this];
|
|
984
|
-
Listener.sourceSlots = [sSlot];
|
|
985
|
-
} else {
|
|
986
|
-
Listener.sources.push(this);
|
|
987
|
-
Listener.sourceSlots.push(sSlot);
|
|
988
|
-
}
|
|
989
|
-
if (!this.observers) {
|
|
990
|
-
this.observers = [Listener];
|
|
991
|
-
this.observerSlots = [Listener.sources.length - 1];
|
|
992
|
-
} else {
|
|
993
|
-
this.observers.push(Listener);
|
|
994
|
-
this.observerSlots.push(Listener.sources.length - 1);
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
if (runningTransition && Transition.sources.has(this)) return this.tValue;
|
|
998
|
-
return this.value;
|
|
999
|
-
}
|
|
1000
|
-
function writeSignal(node, value, isComp) {
|
|
1001
|
-
let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
|
|
1002
|
-
if (!node.comparator || !node.comparator(current, value)) {
|
|
1003
|
-
if (Transition) {
|
|
1004
|
-
const TransitionRunning = Transition.running;
|
|
1005
|
-
if (TransitionRunning || !isComp && Transition.sources.has(node)) {
|
|
1006
|
-
Transition.sources.add(node);
|
|
1007
|
-
node.tValue = value;
|
|
1008
|
-
}
|
|
1009
|
-
if (!TransitionRunning) node.value = value;
|
|
1010
|
-
} else node.value = value;
|
|
1011
|
-
if (node.observers && node.observers.length) {
|
|
1012
|
-
runUpdates(() => {
|
|
1013
|
-
for (let i = 0; i < node.observers.length; i += 1) {
|
|
1014
|
-
const o = node.observers[i];
|
|
1015
|
-
const TransitionRunning = Transition && Transition.running;
|
|
1016
|
-
if (TransitionRunning && Transition.disposed.has(o)) continue;
|
|
1017
|
-
if (TransitionRunning ? !o.tState : !o.state) {
|
|
1018
|
-
if (o.pure) Updates.push(o);
|
|
1019
|
-
else Effects.push(o);
|
|
1020
|
-
if (o.observers) markDownstream(o);
|
|
1021
|
-
}
|
|
1022
|
-
if (!TransitionRunning) o.state = STALE;
|
|
1023
|
-
else o.tState = STALE;
|
|
1024
|
-
}
|
|
1025
|
-
if (Updates.length > 1e6) {
|
|
1026
|
-
Updates = [];
|
|
1027
|
-
if (false) ;
|
|
1028
|
-
throw new Error();
|
|
1029
|
-
}
|
|
1030
|
-
}, false);
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
return value;
|
|
1034
|
-
}
|
|
1035
|
-
function updateComputation(node) {
|
|
1036
|
-
if (!node.fn) return;
|
|
1037
|
-
cleanNode(node);
|
|
1038
|
-
const time = ExecCount;
|
|
1039
|
-
runComputation(
|
|
1040
|
-
node,
|
|
1041
|
-
Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
|
|
1042
|
-
time
|
|
1043
|
-
);
|
|
1044
|
-
if (Transition && !Transition.running && Transition.sources.has(node)) {
|
|
1045
|
-
queueMicrotask(() => {
|
|
1046
|
-
runUpdates(() => {
|
|
1047
|
-
Transition && (Transition.running = true);
|
|
1048
|
-
Listener = Owner = node;
|
|
1049
|
-
runComputation(node, node.tValue, time);
|
|
1050
|
-
Listener = Owner = null;
|
|
1051
|
-
}, false);
|
|
1052
|
-
});
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
function runComputation(node, value, time) {
|
|
1056
|
-
let nextValue;
|
|
1057
|
-
const owner = Owner, listener = Listener;
|
|
1058
|
-
Listener = Owner = node;
|
|
1059
|
-
try {
|
|
1060
|
-
nextValue = node.fn(value);
|
|
1061
|
-
} catch (err) {
|
|
1062
|
-
if (node.pure) {
|
|
1063
|
-
if (Transition && Transition.running) {
|
|
1064
|
-
node.tState = STALE;
|
|
1065
|
-
node.tOwned && node.tOwned.forEach(cleanNode);
|
|
1066
|
-
node.tOwned = void 0;
|
|
1067
|
-
} else {
|
|
1068
|
-
node.state = STALE;
|
|
1069
|
-
node.owned && node.owned.forEach(cleanNode);
|
|
1070
|
-
node.owned = null;
|
|
1071
|
-
}
|
|
1072
|
-
}
|
|
1073
|
-
node.updatedAt = time + 1;
|
|
1074
|
-
return handleError(err);
|
|
1075
|
-
} finally {
|
|
1076
|
-
Listener = listener;
|
|
1077
|
-
Owner = owner;
|
|
1078
|
-
}
|
|
1079
|
-
if (!node.updatedAt || node.updatedAt <= time) {
|
|
1080
|
-
if (node.updatedAt != null && "observers" in node) {
|
|
1081
|
-
writeSignal(node, nextValue, true);
|
|
1082
|
-
} else if (Transition && Transition.running && node.pure) {
|
|
1083
|
-
Transition.sources.add(node);
|
|
1084
|
-
node.tValue = nextValue;
|
|
1085
|
-
} else node.value = nextValue;
|
|
1086
|
-
node.updatedAt = time;
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
function createComputation(fn, init, pure, state = STALE, options) {
|
|
1090
|
-
const c = {
|
|
1091
|
-
fn,
|
|
1092
|
-
state,
|
|
1093
|
-
updatedAt: null,
|
|
1094
|
-
owned: null,
|
|
1095
|
-
sources: null,
|
|
1096
|
-
sourceSlots: null,
|
|
1097
|
-
cleanups: null,
|
|
1098
|
-
value: init,
|
|
1099
|
-
owner: Owner,
|
|
1100
|
-
context: Owner ? Owner.context : null,
|
|
1101
|
-
pure
|
|
1102
|
-
};
|
|
1103
|
-
if (Transition && Transition.running) {
|
|
1104
|
-
c.state = 0;
|
|
1105
|
-
c.tState = state;
|
|
1106
|
-
}
|
|
1107
|
-
if (Owner === null) ;
|
|
1108
|
-
else if (Owner !== UNOWNED) {
|
|
1109
|
-
if (Transition && Transition.running && Owner.pure) {
|
|
1110
|
-
if (!Owner.tOwned) Owner.tOwned = [c];
|
|
1111
|
-
else Owner.tOwned.push(c);
|
|
1112
|
-
} else {
|
|
1113
|
-
if (!Owner.owned) Owner.owned = [c];
|
|
1114
|
-
else Owner.owned.push(c);
|
|
1115
|
-
}
|
|
1116
|
-
}
|
|
1117
|
-
if (ExternalSourceConfig && c.fn) {
|
|
1118
|
-
const [track, trigger] = createSignal(void 0, {
|
|
1119
|
-
equals: false
|
|
1120
|
-
});
|
|
1121
|
-
const ordinary = ExternalSourceConfig.factory(c.fn, trigger);
|
|
1122
|
-
onCleanup(() => ordinary.dispose());
|
|
1123
|
-
const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());
|
|
1124
|
-
const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);
|
|
1125
|
-
c.fn = (x) => {
|
|
1126
|
-
track();
|
|
1127
|
-
return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);
|
|
1128
|
-
};
|
|
1129
|
-
}
|
|
1130
|
-
return c;
|
|
1131
|
-
}
|
|
1132
|
-
function runTop(node) {
|
|
1133
|
-
const runningTransition = Transition && Transition.running;
|
|
1134
|
-
if ((runningTransition ? node.tState : node.state) === 0) return;
|
|
1135
|
-
if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);
|
|
1136
|
-
if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);
|
|
1137
|
-
const ancestors = [node];
|
|
1138
|
-
while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {
|
|
1139
|
-
if (runningTransition && Transition.disposed.has(node)) return;
|
|
1140
|
-
if (runningTransition ? node.tState : node.state) ancestors.push(node);
|
|
1141
|
-
}
|
|
1142
|
-
for (let i = ancestors.length - 1; i >= 0; i--) {
|
|
1143
|
-
node = ancestors[i];
|
|
1144
|
-
if (runningTransition) {
|
|
1145
|
-
let top = node, prev = ancestors[i + 1];
|
|
1146
|
-
while ((top = top.owner) && top !== prev) {
|
|
1147
|
-
if (Transition.disposed.has(top)) return;
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
if ((runningTransition ? node.tState : node.state) === STALE) {
|
|
1151
|
-
updateComputation(node);
|
|
1152
|
-
} else if ((runningTransition ? node.tState : node.state) === PENDING) {
|
|
1153
|
-
const updates = Updates;
|
|
1154
|
-
Updates = null;
|
|
1155
|
-
runUpdates(() => lookUpstream(node, ancestors[0]), false);
|
|
1156
|
-
Updates = updates;
|
|
1157
|
-
}
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
function runUpdates(fn, init) {
|
|
1161
|
-
if (Updates) return fn();
|
|
1162
|
-
let wait = false;
|
|
1163
|
-
if (!init) Updates = [];
|
|
1164
|
-
if (Effects) wait = true;
|
|
1165
|
-
else Effects = [];
|
|
1166
|
-
ExecCount++;
|
|
1167
|
-
try {
|
|
1168
|
-
const res = fn();
|
|
1169
|
-
completeUpdates(wait);
|
|
1170
|
-
return res;
|
|
1171
|
-
} catch (err) {
|
|
1172
|
-
if (!wait) Effects = null;
|
|
1173
|
-
Updates = null;
|
|
1174
|
-
handleError(err);
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
function completeUpdates(wait) {
|
|
1178
|
-
if (Updates) {
|
|
1179
|
-
if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);
|
|
1180
|
-
else runQueue(Updates);
|
|
1181
|
-
Updates = null;
|
|
1182
|
-
}
|
|
1183
|
-
if (wait) return;
|
|
1184
|
-
let res;
|
|
1185
|
-
if (Transition) {
|
|
1186
|
-
if (!Transition.promises.size && !Transition.queue.size) {
|
|
1187
|
-
const sources = Transition.sources;
|
|
1188
|
-
const disposed = Transition.disposed;
|
|
1189
|
-
Effects.push.apply(Effects, Transition.effects);
|
|
1190
|
-
res = Transition.resolve;
|
|
1191
|
-
for (const e2 of Effects) {
|
|
1192
|
-
"tState" in e2 && (e2.state = e2.tState);
|
|
1193
|
-
delete e2.tState;
|
|
1194
|
-
}
|
|
1195
|
-
Transition = null;
|
|
1196
|
-
runUpdates(() => {
|
|
1197
|
-
for (const d of disposed) cleanNode(d);
|
|
1198
|
-
for (const v of sources) {
|
|
1199
|
-
v.value = v.tValue;
|
|
1200
|
-
if (v.owned) {
|
|
1201
|
-
for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);
|
|
1202
|
-
}
|
|
1203
|
-
if (v.tOwned) v.owned = v.tOwned;
|
|
1204
|
-
delete v.tValue;
|
|
1205
|
-
delete v.tOwned;
|
|
1206
|
-
v.tState = 0;
|
|
1207
|
-
}
|
|
1208
|
-
setTransPending(false);
|
|
1209
|
-
}, false);
|
|
1210
|
-
} else if (Transition.running) {
|
|
1211
|
-
Transition.running = false;
|
|
1212
|
-
Transition.effects.push.apply(Transition.effects, Effects);
|
|
1213
|
-
Effects = null;
|
|
1214
|
-
setTransPending(true);
|
|
1215
|
-
return;
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
const e = Effects;
|
|
1219
|
-
Effects = null;
|
|
1220
|
-
if (e.length) runUpdates(() => runEffects(e), false);
|
|
1221
|
-
if (res) res();
|
|
1222
|
-
}
|
|
1223
|
-
function runQueue(queue) {
|
|
1224
|
-
for (let i = 0; i < queue.length; i++) runTop(queue[i]);
|
|
1225
|
-
}
|
|
1226
|
-
function scheduleQueue(queue) {
|
|
1227
|
-
for (let i = 0; i < queue.length; i++) {
|
|
1228
|
-
const item = queue[i];
|
|
1229
|
-
const tasks = Transition.queue;
|
|
1230
|
-
if (!tasks.has(item)) {
|
|
1231
|
-
tasks.add(item);
|
|
1232
|
-
Scheduler(() => {
|
|
1233
|
-
tasks.delete(item);
|
|
1234
|
-
runUpdates(() => {
|
|
1235
|
-
Transition.running = true;
|
|
1236
|
-
runTop(item);
|
|
1237
|
-
}, false);
|
|
1238
|
-
Transition && (Transition.running = false);
|
|
1239
|
-
});
|
|
1240
|
-
}
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
function runUserEffects(queue) {
|
|
1244
|
-
let i, userLength = 0;
|
|
1245
|
-
for (i = 0; i < queue.length; i++) {
|
|
1246
|
-
const e = queue[i];
|
|
1247
|
-
if (!e.user) runTop(e);
|
|
1248
|
-
else queue[userLength++] = e;
|
|
1249
|
-
}
|
|
1250
|
-
if (sharedConfig.context) {
|
|
1251
|
-
if (sharedConfig.count) {
|
|
1252
|
-
sharedConfig.effects || (sharedConfig.effects = []);
|
|
1253
|
-
sharedConfig.effects.push(...queue.slice(0, userLength));
|
|
1254
|
-
return;
|
|
1255
|
-
} else if (sharedConfig.effects) {
|
|
1256
|
-
queue = [...sharedConfig.effects, ...queue];
|
|
1257
|
-
userLength += sharedConfig.effects.length;
|
|
1258
|
-
delete sharedConfig.effects;
|
|
1259
|
-
}
|
|
1260
|
-
setHydrateContext();
|
|
1261
|
-
}
|
|
1262
|
-
for (i = 0; i < userLength; i++) runTop(queue[i]);
|
|
1263
|
-
}
|
|
1264
|
-
function lookUpstream(node, ignore) {
|
|
1265
|
-
const runningTransition = Transition && Transition.running;
|
|
1266
|
-
if (runningTransition) node.tState = 0;
|
|
1267
|
-
else node.state = 0;
|
|
1268
|
-
for (let i = 0; i < node.sources.length; i += 1) {
|
|
1269
|
-
const source = node.sources[i];
|
|
1270
|
-
if (source.sources) {
|
|
1271
|
-
const state = runningTransition ? source.tState : source.state;
|
|
1272
|
-
if (state === STALE) {
|
|
1273
|
-
if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
|
|
1274
|
-
runTop(source);
|
|
1275
|
-
} else if (state === PENDING) lookUpstream(source, ignore);
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
|
-
function markDownstream(node) {
|
|
1280
|
-
const runningTransition = Transition && Transition.running;
|
|
1281
|
-
for (let i = 0; i < node.observers.length; i += 1) {
|
|
1282
|
-
const o = node.observers[i];
|
|
1283
|
-
if (runningTransition ? !o.tState : !o.state) {
|
|
1284
|
-
if (runningTransition) o.tState = PENDING;
|
|
1285
|
-
else o.state = PENDING;
|
|
1286
|
-
if (o.pure) Updates.push(o);
|
|
1287
|
-
else Effects.push(o);
|
|
1288
|
-
o.observers && markDownstream(o);
|
|
1289
|
-
}
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
function cleanNode(node) {
|
|
1293
|
-
let i;
|
|
1294
|
-
if (node.sources) {
|
|
1295
|
-
while (node.sources.length) {
|
|
1296
|
-
const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;
|
|
1297
|
-
if (obs && obs.length) {
|
|
1298
|
-
const n = obs.pop(), s = source.observerSlots.pop();
|
|
1299
|
-
if (index < obs.length) {
|
|
1300
|
-
n.sourceSlots[s] = index;
|
|
1301
|
-
obs[index] = n;
|
|
1302
|
-
source.observerSlots[index] = s;
|
|
1303
|
-
}
|
|
1304
|
-
}
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
if (Transition && Transition.running && node.pure) {
|
|
1308
|
-
if (node.tOwned) {
|
|
1309
|
-
for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);
|
|
1310
|
-
delete node.tOwned;
|
|
1311
|
-
}
|
|
1312
|
-
reset(node, true);
|
|
1313
|
-
} else if (node.owned) {
|
|
1314
|
-
for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);
|
|
1315
|
-
node.owned = null;
|
|
1316
|
-
}
|
|
1317
|
-
if (node.cleanups) {
|
|
1318
|
-
for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
|
|
1319
|
-
node.cleanups = null;
|
|
1320
|
-
}
|
|
1321
|
-
if (Transition && Transition.running) node.tState = 0;
|
|
1322
|
-
else node.state = 0;
|
|
1323
|
-
}
|
|
1324
|
-
function reset(node, top) {
|
|
1325
|
-
if (!top) {
|
|
1326
|
-
node.tState = 0;
|
|
1327
|
-
Transition.disposed.add(node);
|
|
1328
|
-
}
|
|
1329
|
-
if (node.owned) {
|
|
1330
|
-
for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
|
-
function castError(err) {
|
|
1334
|
-
if (err instanceof Error) return err;
|
|
1335
|
-
return new Error(typeof err === "string" ? err : "Unknown error", {
|
|
1336
|
-
cause: err
|
|
1337
|
-
});
|
|
1338
|
-
}
|
|
1339
|
-
function runErrors(err, fns, owner) {
|
|
1340
|
-
try {
|
|
1341
|
-
for (const f of fns) f(err);
|
|
1342
|
-
} catch (e) {
|
|
1343
|
-
handleError(e, owner && owner.owner || null);
|
|
1344
|
-
}
|
|
1345
|
-
}
|
|
1346
|
-
function handleError(err, owner = Owner) {
|
|
1347
|
-
const fns = ERROR && owner && owner.context && owner.context[ERROR];
|
|
1348
|
-
const error = castError(err);
|
|
1349
|
-
if (!fns) throw error;
|
|
1350
|
-
if (Effects)
|
|
1351
|
-
Effects.push({
|
|
1352
|
-
fn() {
|
|
1353
|
-
runErrors(error, fns, owner);
|
|
1354
|
-
},
|
|
1355
|
-
state: STALE
|
|
1356
|
-
});
|
|
1357
|
-
else runErrors(error, fns, owner);
|
|
1358
|
-
}
|
|
1359
|
-
function resolveChildren(children2) {
|
|
1360
|
-
if (typeof children2 === "function" && !children2.length) return resolveChildren(children2());
|
|
1361
|
-
if (Array.isArray(children2)) {
|
|
1362
|
-
const results = [];
|
|
1363
|
-
for (let i = 0; i < children2.length; i++) {
|
|
1364
|
-
const result = resolveChildren(children2[i]);
|
|
1365
|
-
Array.isArray(result) ? results.push.apply(results, result) : results.push(result);
|
|
1366
|
-
}
|
|
1367
|
-
return results;
|
|
1368
|
-
}
|
|
1369
|
-
return children2;
|
|
1370
|
-
}
|
|
1371
|
-
function createProvider(id, options) {
|
|
1372
|
-
return function provider(props) {
|
|
1373
|
-
let res;
|
|
1374
|
-
createRenderEffect(
|
|
1375
|
-
() => res = untrack(() => {
|
|
1376
|
-
Owner.context = {
|
|
1377
|
-
...Owner.context,
|
|
1378
|
-
[id]: props.value
|
|
1379
|
-
};
|
|
1380
|
-
return children(() => props.children);
|
|
1381
|
-
}),
|
|
1382
|
-
void 0
|
|
1383
|
-
);
|
|
1384
|
-
return res;
|
|
1385
|
-
};
|
|
1386
|
-
}
|
|
1387
|
-
var FALLBACK = Symbol("fallback");
|
|
1388
|
-
var SuspenseListContext = createContext();
|
|
806
|
+
// src/components/Editor.tsx
|
|
807
|
+
import { createEffect, createSignal, on, onCleanup, onMount } from "solid-js";
|
|
808
|
+
import { Dynamic } from "solid-js/web";
|
|
1389
809
|
|
|
1390
810
|
// src/components/EditorPropTypes.ts
|
|
1391
811
|
var PropTypes = __toESM(require_prop_types(), 1);
|
|
@@ -1505,7 +925,7 @@ var EditorPropTypes = {
|
|
|
1505
925
|
// src/Utils.ts
|
|
1506
926
|
var isFunction = (x) => typeof x === "function";
|
|
1507
927
|
var isEventProp = (name) => name in eventPropTypes;
|
|
1508
|
-
var eventAttrToEventName = (attrName) => attrName.
|
|
928
|
+
var eventAttrToEventName = (attrName) => String(attrName.slice(2));
|
|
1509
929
|
var configHandlers2 = (handlerLookup, on2, off, adapter, prevProps, props, boundHandlers) => {
|
|
1510
930
|
const prevEventKeys = Object.keys(prevProps).filter(isEventProp);
|
|
1511
931
|
const currEventKeys = Object.keys(props).filter(isEventProp);
|
|
@@ -1700,12 +1120,13 @@ var getTinymce = (view) => {
|
|
|
1700
1120
|
return global && global.tinymce ? global.tinymce : null;
|
|
1701
1121
|
};
|
|
1702
1122
|
|
|
1703
|
-
// src/components/
|
|
1704
|
-
var
|
|
1123
|
+
// src/components/Editor.tsx
|
|
1124
|
+
var Editor = (props) => {
|
|
1705
1125
|
const [id] = createSignal(props.id || uuid("solid-tinymce-editor"));
|
|
1706
1126
|
const initialValue = () => props.initialValue;
|
|
1707
1127
|
const value = () => props.value || "";
|
|
1708
1128
|
const skin = () => props.skin || "oxide";
|
|
1129
|
+
const tagName = () => props.tagName || "div";
|
|
1709
1130
|
const contentCss = () => props.contentCss || "default";
|
|
1710
1131
|
const disabled = () => props.disabled || false;
|
|
1711
1132
|
const [editor, setEditor] = createSignal();
|
|
@@ -1976,23 +1397,18 @@ var SolidEditor = (props) => {
|
|
|
1976
1397
|
handleBeforeInput(evt);
|
|
1977
1398
|
}
|
|
1978
1399
|
};
|
|
1979
|
-
return
|
|
1980
|
-
|
|
1981
|
-
ref={props.elementRef}
|
|
1400
|
+
return <Dynamic
|
|
1401
|
+
component={props.inline ? tagName() : "textarea"}
|
|
1982
1402
|
id={id()}
|
|
1983
1403
|
data-testid={props.testid}
|
|
1984
1404
|
tabIndex={props.tabIndex}
|
|
1985
|
-
/> : <textarea
|
|
1986
|
-
style={{ visibility: "hidden" }}
|
|
1987
1405
|
ref={props.elementRef}
|
|
1988
|
-
|
|
1989
|
-
data-testid={props.testid}
|
|
1990
|
-
tabIndex={props.tabIndex}
|
|
1406
|
+
{...props}
|
|
1991
1407
|
/>;
|
|
1992
1408
|
};
|
|
1993
1409
|
|
|
1994
1410
|
// src/index.tsx
|
|
1995
|
-
var src_default =
|
|
1411
|
+
var src_default = Editor;
|
|
1996
1412
|
export {
|
|
1997
1413
|
EditorPropTypes,
|
|
1998
1414
|
src_default as default
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as solid_js from 'solid-js';
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
|
-
import { EditorEvent, Editor, Events, TinyMCE } from 'tinymce';
|
|
3
|
+
import { EditorEvent, Editor as Editor$1, Events, TinyMCE } from 'tinymce';
|
|
4
4
|
|
|
5
|
-
type EventHandler<A> = (a: EditorEvent<A>, editor: Editor) => unknown;
|
|
5
|
+
type EventHandler<A> = (a: EditorEvent<A>, editor: Editor$1) => unknown;
|
|
6
6
|
type EEventHandler<K extends keyof Events.EditorEventMap> = EventHandler<Events.EditorEventMap[K]>;
|
|
7
7
|
interface INativeEvents {
|
|
8
8
|
onBeforePaste: EEventHandler<"beforepaste">;
|
|
@@ -117,7 +117,7 @@ interface IProps {
|
|
|
117
117
|
testid: string;
|
|
118
118
|
inline: boolean;
|
|
119
119
|
initialValue: string;
|
|
120
|
-
onEditorChange: (content: string, editor: Editor) => void;
|
|
120
|
+
onEditorChange: (content: string, editor: Editor$1) => void;
|
|
121
121
|
value: string;
|
|
122
122
|
init: InitOptions;
|
|
123
123
|
tagName: string;
|
|
@@ -250,6 +250,6 @@ declare const EditorPropTypes: {
|
|
|
250
250
|
}>>;
|
|
251
251
|
};
|
|
252
252
|
|
|
253
|
-
declare const
|
|
253
|
+
declare const Editor: (props: Partial<IAllProps>) => solid_js.JSX.Element;
|
|
254
254
|
|
|
255
|
-
export { EditorPropTypes, type IAllProps,
|
|
255
|
+
export { EditorPropTypes, type IAllProps, Editor as default };
|