@djangocfg/ui-tools 2.1.290 → 2.1.291

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/index.cjs CHANGED
@@ -1299,6 +1299,14 @@ function MarkdownEditor({
1299
1299
  onMentionIdsChange
1300
1300
  }) {
1301
1301
  const isExternalUpdate = React.useRef(false);
1302
+ const initialMentionsDefinedRef = React.useRef(mentions !== void 0);
1303
+ const warnedRef = React.useRef(false);
1304
+ if (process.env.NODE_ENV !== "production" && !initialMentionsDefinedRef.current && mentions !== void 0 && !warnedRef.current) {
1305
+ warnedRef.current = true;
1306
+ console.warn(
1307
+ "[MarkdownEditor] `mentions` flipped from undefined to a config after mount. Tiptap only installs the Mention extension on first render \u2014 the @-popover will NOT work for this editor instance. Pass `{ items: [] }` from the very first render and mutate `.items` in place instead."
1308
+ );
1309
+ }
1302
1310
  const extensions = React.useMemo(() => {
1303
1311
  const exts = [
1304
1312
  StarterKit__default.default.configure({ heading: { levels: [1, 2, 3] } }),