@wdprlib/ast 1.0.0 → 1.1.1

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
@@ -45,10 +45,13 @@ __export(exports_src, {
45
45
  isAlignType: () => isAlignType,
46
46
  horizontalRule: () => horizontalRule,
47
47
  heading: () => heading,
48
+ createSettings: () => createSettings,
48
49
  createPosition: () => createPosition,
49
50
  createPoint: () => createPoint,
50
51
  container: () => container,
51
- bold: () => bold
52
+ bold: () => bold,
53
+ STYLE_SLOT_PREFIX: () => STYLE_SLOT_PREFIX,
54
+ DEFAULT_SETTINGS: () => DEFAULT_SETTINGS
52
55
  });
53
56
  module.exports = __toCommonJS(exports_src);
54
57
 
@@ -245,3 +248,36 @@ function isParagraphSafe(element) {
245
248
  return false;
246
249
  }
247
250
  }
251
+ // packages/ast/src/constants.ts
252
+ var STYLE_SLOT_PREFIX = "\x00__IFTAGS_SLOT__";
253
+ // packages/ast/src/settings.ts
254
+ function createSettings(mode) {
255
+ switch (mode) {
256
+ case "page":
257
+ return {
258
+ mode,
259
+ enablePageSyntax: true,
260
+ allowLocalPaths: true,
261
+ useTrueIds: true,
262
+ allowStyleElements: true
263
+ };
264
+ case "draft":
265
+ return {
266
+ mode,
267
+ enablePageSyntax: true,
268
+ allowLocalPaths: true,
269
+ useTrueIds: false,
270
+ allowStyleElements: false
271
+ };
272
+ case "forum-post":
273
+ case "direct-message":
274
+ return {
275
+ mode,
276
+ enablePageSyntax: false,
277
+ allowLocalPaths: false,
278
+ useTrueIds: false,
279
+ allowStyleElements: false
280
+ };
281
+ }
282
+ }
283
+ var DEFAULT_SETTINGS = createSettings("page");