@semantic-components/editor 0.63.0 → 0.65.0

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.
Files changed (132) hide show
  1. package/esm2022/index.js +2 -0
  2. package/esm2022/index.js.map +1 -0
  3. package/esm2022/lib/components/editor/editor-align-center-button.js +38 -0
  4. package/esm2022/lib/components/editor/editor-align-center-button.js.map +1 -0
  5. package/esm2022/lib/components/editor/editor-align-justify-button.js +38 -0
  6. package/esm2022/lib/components/editor/editor-align-justify-button.js.map +1 -0
  7. package/esm2022/lib/components/editor/editor-align-left-button.js +37 -0
  8. package/esm2022/lib/components/editor/editor-align-left-button.js.map +1 -0
  9. package/esm2022/lib/components/editor/editor-align-right-button.js +37 -0
  10. package/esm2022/lib/components/editor/editor-align-right-button.js.map +1 -0
  11. package/esm2022/lib/components/editor/editor-blockquote-button.js +37 -0
  12. package/esm2022/lib/components/editor/editor-blockquote-button.js.map +1 -0
  13. package/esm2022/lib/components/editor/editor-bold-button.js +37 -0
  14. package/esm2022/lib/components/editor/editor-bold-button.js.map +1 -0
  15. package/esm2022/lib/components/editor/editor-bullet-list-button.js +37 -0
  16. package/esm2022/lib/components/editor/editor-bullet-list-button.js.map +1 -0
  17. package/esm2022/lib/components/editor/editor-char-count.js +40 -0
  18. package/esm2022/lib/components/editor/editor-char-count.js.map +1 -0
  19. package/esm2022/lib/components/editor/editor-clear-formatting-button.js +36 -0
  20. package/esm2022/lib/components/editor/editor-clear-formatting-button.js.map +1 -0
  21. package/esm2022/lib/components/editor/editor-code-button.js +46 -0
  22. package/esm2022/lib/components/editor/editor-code-button.js.map +1 -0
  23. package/esm2022/lib/components/editor/editor-content.js +78 -0
  24. package/esm2022/lib/components/editor/editor-content.js.map +1 -0
  25. package/esm2022/lib/components/editor/editor-count.js +27 -0
  26. package/esm2022/lib/components/editor/editor-count.js.map +1 -0
  27. package/esm2022/lib/components/editor/editor-footer.js +27 -0
  28. package/esm2022/lib/components/editor/editor-footer.js.map +1 -0
  29. package/esm2022/lib/components/editor/editor-header.js +27 -0
  30. package/esm2022/lib/components/editor/editor-header.js.map +1 -0
  31. package/esm2022/lib/components/editor/editor-heading-select.js +48 -0
  32. package/esm2022/lib/components/editor/editor-heading-select.js.map +1 -0
  33. package/esm2022/lib/components/editor/editor-horizontal-rule-button.js +36 -0
  34. package/esm2022/lib/components/editor/editor-horizontal-rule-button.js.map +1 -0
  35. package/esm2022/lib/components/editor/editor-italic-button.js +37 -0
  36. package/esm2022/lib/components/editor/editor-italic-button.js.map +1 -0
  37. package/esm2022/lib/components/editor/editor-link-button.js +52 -0
  38. package/esm2022/lib/components/editor/editor-link-button.js.map +1 -0
  39. package/esm2022/lib/components/editor/editor-numbered-list-button.js +37 -0
  40. package/esm2022/lib/components/editor/editor-numbered-list-button.js.map +1 -0
  41. package/esm2022/lib/components/editor/editor-redo-button.js +36 -0
  42. package/esm2022/lib/components/editor/editor-redo-button.js.map +1 -0
  43. package/esm2022/lib/components/editor/editor-separator.js +23 -0
  44. package/esm2022/lib/components/editor/editor-separator.js.map +1 -0
  45. package/esm2022/lib/components/editor/editor-strikethrough-button.js +37 -0
  46. package/esm2022/lib/components/editor/editor-strikethrough-button.js.map +1 -0
  47. package/esm2022/lib/components/editor/editor-toolbar-group.js +27 -0
  48. package/esm2022/lib/components/editor/editor-toolbar-group.js.map +1 -0
  49. package/esm2022/lib/components/editor/editor-toolbar.js +29 -0
  50. package/esm2022/lib/components/editor/editor-toolbar.js.map +1 -0
  51. package/esm2022/lib/components/editor/editor-underline-button.js +37 -0
  52. package/esm2022/lib/components/editor/editor-underline-button.js.map +1 -0
  53. package/esm2022/lib/components/editor/editor-undo-button.js +36 -0
  54. package/esm2022/lib/components/editor/editor-undo-button.js.map +1 -0
  55. package/esm2022/lib/components/editor/editor-word-count.js +42 -0
  56. package/esm2022/lib/components/editor/editor-word-count.js.map +1 -0
  57. package/esm2022/lib/components/editor/editor.js +197 -0
  58. package/esm2022/lib/components/editor/editor.js.map +1 -0
  59. package/{src/lib/components/editor/index.ts → esm2022/lib/components/editor/index.js} +1 -8
  60. package/esm2022/lib/components/editor/index.js.map +1 -0
  61. package/esm2022/lib/components/index.js +2 -0
  62. package/esm2022/lib/components/index.js.map +1 -0
  63. package/esm2022/semantic-components-editor.js +5 -0
  64. package/esm2022/semantic-components-editor.js.map +1 -0
  65. package/lib/components/editor/editor-align-center-button.d.ts +9 -0
  66. package/lib/components/editor/editor-align-justify-button.d.ts +9 -0
  67. package/lib/components/editor/editor-align-left-button.d.ts +9 -0
  68. package/lib/components/editor/editor-align-right-button.d.ts +9 -0
  69. package/lib/components/editor/editor-blockquote-button.d.ts +9 -0
  70. package/lib/components/editor/editor-bold-button.d.ts +9 -0
  71. package/lib/components/editor/editor-bullet-list-button.d.ts +9 -0
  72. package/lib/components/editor/editor-char-count.d.ts +10 -0
  73. package/lib/components/editor/editor-clear-formatting-button.d.ts +9 -0
  74. package/lib/components/editor/editor-code-button.d.ts +9 -0
  75. package/lib/components/editor/editor-content.d.ts +18 -0
  76. package/lib/components/editor/editor-count.d.ts +7 -0
  77. package/lib/components/editor/editor-footer.d.ts +7 -0
  78. package/lib/components/editor/editor-header.d.ts +7 -0
  79. package/lib/components/editor/editor-heading-select.d.ts +9 -0
  80. package/lib/components/editor/editor-horizontal-rule-button.d.ts +9 -0
  81. package/lib/components/editor/editor-italic-button.d.ts +9 -0
  82. package/lib/components/editor/editor-link-button.d.ts +9 -0
  83. package/lib/components/editor/editor-numbered-list-button.d.ts +9 -0
  84. package/lib/components/editor/editor-redo-button.d.ts +9 -0
  85. package/lib/components/editor/editor-separator.d.ts +7 -0
  86. package/lib/components/editor/editor-strikethrough-button.d.ts +9 -0
  87. package/lib/components/editor/editor-toolbar-group.d.ts +7 -0
  88. package/lib/components/editor/editor-toolbar.d.ts +7 -0
  89. package/lib/components/editor/editor-underline-button.d.ts +9 -0
  90. package/lib/components/editor/editor-undo-button.d.ts +9 -0
  91. package/lib/components/editor/editor-word-count.d.ts +10 -0
  92. package/lib/components/editor/editor.d.ts +29 -0
  93. package/lib/components/editor/index.d.ts +28 -0
  94. package/package.json +15 -3
  95. package/semantic-components-editor.d.ts +5 -0
  96. package/eslint.config.mjs +0 -48
  97. package/ng-package.json +0 -8
  98. package/project.json +0 -28
  99. package/src/lib/components/editor/README.md +0 -354
  100. package/src/lib/components/editor/editor-align-center-button.ts +0 -45
  101. package/src/lib/components/editor/editor-align-justify-button.ts +0 -45
  102. package/src/lib/components/editor/editor-align-left-button.ts +0 -44
  103. package/src/lib/components/editor/editor-align-right-button.ts +0 -44
  104. package/src/lib/components/editor/editor-blockquote-button.ts +0 -44
  105. package/src/lib/components/editor/editor-bold-button.ts +0 -44
  106. package/src/lib/components/editor/editor-bullet-list-button.ts +0 -44
  107. package/src/lib/components/editor/editor-char-count.ts +0 -42
  108. package/src/lib/components/editor/editor-clear-formatting-button.ts +0 -42
  109. package/src/lib/components/editor/editor-code-button.ts +0 -52
  110. package/src/lib/components/editor/editor-content.ts +0 -107
  111. package/src/lib/components/editor/editor-count.ts +0 -28
  112. package/src/lib/components/editor/editor-footer.ts +0 -30
  113. package/src/lib/components/editor/editor-header.ts +0 -27
  114. package/src/lib/components/editor/editor-heading-select.ts +0 -48
  115. package/src/lib/components/editor/editor-horizontal-rule-button.ts +0 -42
  116. package/src/lib/components/editor/editor-italic-button.ts +0 -44
  117. package/src/lib/components/editor/editor-link-button.ts +0 -58
  118. package/src/lib/components/editor/editor-numbered-list-button.ts +0 -44
  119. package/src/lib/components/editor/editor-redo-button.ts +0 -42
  120. package/src/lib/components/editor/editor-separator.ts +0 -25
  121. package/src/lib/components/editor/editor-strikethrough-button.ts +0 -44
  122. package/src/lib/components/editor/editor-toolbar-group.ts +0 -27
  123. package/src/lib/components/editor/editor-toolbar.ts +0 -32
  124. package/src/lib/components/editor/editor-underline-button.ts +0 -44
  125. package/src/lib/components/editor/editor-undo-button.ts +0 -42
  126. package/src/lib/components/editor/editor-word-count.ts +0 -43
  127. package/src/lib/components/editor/editor.ts +0 -211
  128. package/tsconfig.json +0 -28
  129. package/tsconfig.lib.json +0 -12
  130. package/tsconfig.lib.prod.json +0 -7
  131. /package/{src/index.ts → index.d.ts} +0 -0
  132. /package/{src/lib/components/index.ts → lib/components/index.d.ts} +0 -0
@@ -0,0 +1,27 @@
1
+ import { Component, ChangeDetectionStrategy, computed, input, ViewEncapsulation, } from '@angular/core';
2
+ import { cn } from '@semantic-components/ui';
3
+ import * as i0 from "@angular/core";
4
+ export class ScEditorCount {
5
+ classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
6
+ class = computed(() => cn('flex items-center justify-end gap-4', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
7
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorCount, deps: [], target: i0.ɵɵFactoryTarget.Component });
8
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.4", type: ScEditorCount, isStandalone: true, selector: "div[sc-editor-count]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "editor-count" }, properties: { "class": "class()" } }, ngImport: i0, template: `
9
+ <ng-content />
10
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
11
+ }
12
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorCount, decorators: [{
13
+ type: Component,
14
+ args: [{
15
+ selector: 'div[sc-editor-count]',
16
+ template: `
17
+ <ng-content />
18
+ `,
19
+ host: {
20
+ 'data-slot': 'editor-count',
21
+ '[class]': 'class()',
22
+ },
23
+ encapsulation: ViewEncapsulation.None,
24
+ changeDetection: ChangeDetectionStrategy.OnPush,
25
+ }]
26
+ }], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
27
+ //# sourceMappingURL=editor-count.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-count.js","sourceRoot":"","sources":["../../../../../../../libs/editor/src/lib/components/editor/editor-count.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,QAAQ,EACR,KAAK,EACL,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;;AAc7C,MAAM,OAAO,aAAa;IACf,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IAEzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CAAC,qCAAqC,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,iDAC7D,CAAC;uGALS,aAAa;2FAAb,aAAa,yTAVd;;GAET;;2FAQU,aAAa;kBAZzB,SAAS;mBAAC;oBACT,QAAQ,EAAE,sBAAsB;oBAChC,QAAQ,EAAE;;GAET;oBACD,IAAI,EAAE;wBACJ,WAAW,EAAE,cAAc;wBAC3B,SAAS,EAAE,SAAS;qBACrB;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '@semantic-components/ui';\n\n@Component({\n selector: 'div[sc-editor-count]',\n template: `\n <ng-content />\n `,\n host: {\n 'data-slot': 'editor-count',\n '[class]': 'class()',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScEditorCount {\n readonly classInput = input<string>('', { alias: 'class' });\n\n protected readonly class = computed(() =>\n cn('flex items-center justify-end gap-4', this.classInput()),\n );\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import { Component, ChangeDetectionStrategy, computed, input, ViewEncapsulation, } from '@angular/core';
2
+ import { cn } from '@semantic-components/ui';
3
+ import * as i0 from "@angular/core";
4
+ export class ScEditorFooter {
5
+ classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
6
+ class = computed(() => cn('px-3 py-1.5 border-t text-xs text-muted-foreground bg-muted/30', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
7
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorFooter, deps: [], target: i0.ɵɵFactoryTarget.Component });
8
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.4", type: ScEditorFooter, isStandalone: true, selector: "div[sc-editor-footer]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "editor-footer" }, properties: { "class": "class()" } }, ngImport: i0, template: `
9
+ <ng-content />
10
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
11
+ }
12
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorFooter, decorators: [{
13
+ type: Component,
14
+ args: [{
15
+ selector: 'div[sc-editor-footer]',
16
+ template: `
17
+ <ng-content />
18
+ `,
19
+ host: {
20
+ 'data-slot': 'editor-footer',
21
+ '[class]': 'class()',
22
+ },
23
+ encapsulation: ViewEncapsulation.None,
24
+ changeDetection: ChangeDetectionStrategy.OnPush,
25
+ }]
26
+ }], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
27
+ //# sourceMappingURL=editor-footer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-footer.js","sourceRoot":"","sources":["../../../../../../../libs/editor/src/lib/components/editor/editor-footer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,QAAQ,EACR,KAAK,EACL,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;;AAc7C,MAAM,OAAO,cAAc;IAChB,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IACzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CACA,gEAAgE,EAChE,IAAI,CAAC,UAAU,EAAE,CAClB,iDACF,CAAC;uGAPS,cAAc;2FAAd,cAAc,2TAVf;;GAET;;2FAQU,cAAc;kBAZ1B,SAAS;mBAAC;oBACT,QAAQ,EAAE,uBAAuB;oBACjC,QAAQ,EAAE;;GAET;oBACD,IAAI,EAAE;wBACJ,WAAW,EAAE,eAAe;wBAC5B,SAAS,EAAE,SAAS;qBACrB;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '@semantic-components/ui';\n\n@Component({\n selector: 'div[sc-editor-footer]',\n template: `\n <ng-content />\n `,\n host: {\n 'data-slot': 'editor-footer',\n '[class]': 'class()',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScEditorFooter {\n readonly classInput = input<string>('', { alias: 'class' });\n protected readonly class = computed(() =>\n cn(\n 'px-3 py-1.5 border-t text-xs text-muted-foreground bg-muted/30',\n this.classInput(),\n ),\n );\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import { Component, ChangeDetectionStrategy, computed, input, ViewEncapsulation, } from '@angular/core';
2
+ import { cn } from '@semantic-components/ui';
3
+ import * as i0 from "@angular/core";
4
+ export class ScEditorHeader {
5
+ classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
6
+ class = computed(() => cn('px-4 py-3 border-b bg-muted/30', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
7
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
8
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.4", type: ScEditorHeader, isStandalone: true, selector: "div[sc-editor-header]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "editor-header" }, properties: { "class": "class()" } }, ngImport: i0, template: `
9
+ <ng-content />
10
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
11
+ }
12
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorHeader, decorators: [{
13
+ type: Component,
14
+ args: [{
15
+ selector: 'div[sc-editor-header]',
16
+ template: `
17
+ <ng-content />
18
+ `,
19
+ host: {
20
+ 'data-slot': 'editor-header',
21
+ '[class]': 'class()',
22
+ },
23
+ encapsulation: ViewEncapsulation.None,
24
+ changeDetection: ChangeDetectionStrategy.OnPush,
25
+ }]
26
+ }], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
27
+ //# sourceMappingURL=editor-header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-header.js","sourceRoot":"","sources":["../../../../../../../libs/editor/src/lib/components/editor/editor-header.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,QAAQ,EACR,KAAK,EACL,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;;AAc7C,MAAM,OAAO,cAAc;IAChB,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IACzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CAAC,gCAAgC,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,iDACxD,CAAC;uGAJS,cAAc;2FAAd,cAAc,2TAVf;;GAET;;2FAQU,cAAc;kBAZ1B,SAAS;mBAAC;oBACT,QAAQ,EAAE,uBAAuB;oBACjC,QAAQ,EAAE;;GAET;oBACD,IAAI,EAAE;wBACJ,WAAW,EAAE,eAAe;wBAC5B,SAAS,EAAE,SAAS;qBACrB;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '@semantic-components/ui';\n\n@Component({\n selector: 'div[sc-editor-header]',\n template: `\n <ng-content />\n `,\n host: {\n 'data-slot': 'editor-header',\n '[class]': 'class()',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScEditorHeader {\n readonly classInput = input<string>('', { alias: 'class' });\n protected readonly class = computed(() =>\n cn('px-4 py-3 border-b bg-muted/30', this.classInput()),\n );\n}\n"]}
@@ -0,0 +1,48 @@
1
+ import { Component, ChangeDetectionStrategy, computed, input, inject, ViewEncapsulation, } from '@angular/core';
2
+ import { cn } from '@semantic-components/ui';
3
+ import { SC_EDITOR } from './editor';
4
+ import * as i0 from "@angular/core";
5
+ export class ScEditorHeadingSelect {
6
+ editor = inject(SC_EDITOR);
7
+ classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
8
+ class = computed(() => cn('appearance-none pl-2 pr-6 py-1 text-sm rounded border-0 bg-transparent hover:bg-accent cursor-pointer', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
9
+ onChange(event) {
10
+ const value = event.target.value;
11
+ this.editor.execCommand('formatBlock', value === 'p' ? 'p' : value);
12
+ }
13
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorHeadingSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
14
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.4", type: ScEditorHeadingSelect, isStandalone: true, selector: "select[sc-editor-heading]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "editor-heading" }, listeners: { "change": "onChange($event)" }, properties: { "class": "class()", "disabled": "editor.disabled()", "value": "editor.currentHeading()" } }, ngImport: i0, template: `
15
+ <option value="p">Paragraph</option>
16
+ <option value="h1">Heading 1</option>
17
+ <option value="h2">Heading 2</option>
18
+ <option value="h3">Heading 3</option>
19
+ <option value="h4">Heading 4</option>
20
+ <option value="h5">Heading 5</option>
21
+ <option value="h6">Heading 6</option>
22
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
23
+ }
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorHeadingSelect, decorators: [{
25
+ type: Component,
26
+ args: [{
27
+ selector: 'select[sc-editor-heading]',
28
+ template: `
29
+ <option value="p">Paragraph</option>
30
+ <option value="h1">Heading 1</option>
31
+ <option value="h2">Heading 2</option>
32
+ <option value="h3">Heading 3</option>
33
+ <option value="h4">Heading 4</option>
34
+ <option value="h5">Heading 5</option>
35
+ <option value="h6">Heading 6</option>
36
+ `,
37
+ host: {
38
+ 'data-slot': 'editor-heading',
39
+ '[class]': 'class()',
40
+ '[disabled]': 'editor.disabled()',
41
+ '[value]': 'editor.currentHeading()',
42
+ '(change)': 'onChange($event)',
43
+ },
44
+ encapsulation: ViewEncapsulation.None,
45
+ changeDetection: ChangeDetectionStrategy.OnPush,
46
+ }]
47
+ }], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
48
+ //# sourceMappingURL=editor-heading-select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-heading-select.js","sourceRoot":"","sources":["../../../../../../../libs/editor/src/lib/components/editor/editor-heading-select.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,QAAQ,EACR,KAAK,EACL,MAAM,EACN,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAmB,MAAM,UAAU,CAAC;;AAuBtD,MAAM,OAAO,qBAAqB;IACvB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC3B,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IAEzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CACA,uGAAuG,EACvG,IAAI,CAAC,UAAU,EAAE,CAClB,iDACF,CAAC;IAEF,QAAQ,CAAC,KAAY;QACnB,MAAM,KAAK,GAAI,KAAK,CAAC,MAA4B,CAAC,KAAwB,CAAC;QAC3E,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,aAAa,EAAE,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACtE,CAAC;uGAdU,qBAAqB;2FAArB,qBAAqB,kbAnBtB;;;;;;;;GAQT;;2FAWU,qBAAqB;kBArBjC,SAAS;mBAAC;oBACT,QAAQ,EAAE,2BAA2B;oBACrC,QAAQ,EAAE;;;;;;;;GAQT;oBACD,IAAI,EAAE;wBACJ,WAAW,EAAE,gBAAgB;wBAC7B,SAAS,EAAE,SAAS;wBACpB,YAAY,EAAE,mBAAmB;wBACjC,SAAS,EAAE,yBAAyB;wBACpC,UAAU,EAAE,kBAAkB;qBAC/B;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n inject,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '@semantic-components/ui';\nimport { SC_EDITOR, ScEditorHeading } from './editor';\n\n@Component({\n selector: 'select[sc-editor-heading]',\n template: `\n <option value=\"p\">Paragraph</option>\n <option value=\"h1\">Heading 1</option>\n <option value=\"h2\">Heading 2</option>\n <option value=\"h3\">Heading 3</option>\n <option value=\"h4\">Heading 4</option>\n <option value=\"h5\">Heading 5</option>\n <option value=\"h6\">Heading 6</option>\n `,\n host: {\n 'data-slot': 'editor-heading',\n '[class]': 'class()',\n '[disabled]': 'editor.disabled()',\n '[value]': 'editor.currentHeading()',\n '(change)': 'onChange($event)',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScEditorHeadingSelect {\n readonly editor = inject(SC_EDITOR);\n readonly classInput = input<string>('', { alias: 'class' });\n\n protected readonly class = computed(() =>\n cn(\n 'appearance-none pl-2 pr-6 py-1 text-sm rounded border-0 bg-transparent hover:bg-accent cursor-pointer',\n this.classInput(),\n ),\n );\n\n onChange(event: Event): void {\n const value = (event.target as HTMLSelectElement).value as ScEditorHeading;\n this.editor.execCommand('formatBlock', value === 'p' ? 'p' : value);\n }\n}\n"]}
@@ -0,0 +1,36 @@
1
+ import { Component, ChangeDetectionStrategy, computed, input, inject, ViewEncapsulation, } from '@angular/core';
2
+ import { cn } from '@semantic-components/ui';
3
+ import { SC_EDITOR } from './editor';
4
+ import * as i0 from "@angular/core";
5
+ export class ScEditorHorizontalRuleButton {
6
+ editor = inject(SC_EDITOR);
7
+ classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
8
+ class = computed(() => cn('p-1.5 rounded hover:bg-accent disabled:opacity-50 [&_svg]:size-4', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
9
+ onClick() {
10
+ this.editor.execCommand('insertHorizontalRule');
11
+ }
12
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorHorizontalRuleButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
13
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.4", type: ScEditorHorizontalRuleButton, isStandalone: true, selector: "button[sc-editor-horizontal-rule]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "editor-horizontal-rule", "type": "button" }, listeners: { "click": "onClick()" }, properties: { "class": "class()", "disabled": "editor.disabled()", "attr.title": "\"Horizontal line\"" } }, ngImport: i0, template: `
14
+ <ng-content />
15
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
16
+ }
17
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorHorizontalRuleButton, decorators: [{
18
+ type: Component,
19
+ args: [{
20
+ selector: 'button[sc-editor-horizontal-rule]',
21
+ template: `
22
+ <ng-content />
23
+ `,
24
+ host: {
25
+ 'data-slot': 'editor-horizontal-rule',
26
+ type: 'button',
27
+ '[class]': 'class()',
28
+ '[disabled]': 'editor.disabled()',
29
+ '[attr.title]': '"Horizontal line"',
30
+ '(click)': 'onClick()',
31
+ },
32
+ encapsulation: ViewEncapsulation.None,
33
+ changeDetection: ChangeDetectionStrategy.OnPush,
34
+ }]
35
+ }], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
36
+ //# sourceMappingURL=editor-horizontal-rule-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-horizontal-rule-button.js","sourceRoot":"","sources":["../../../../../../../libs/editor/src/lib/components/editor/editor-horizontal-rule-button.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,QAAQ,EACR,KAAK,EACL,MAAM,EACN,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;;AAkBrC,MAAM,OAAO,4BAA4B;IAC9B,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC3B,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IAEzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CACA,kEAAkE,EAClE,IAAI,CAAC,UAAU,EAAE,CAClB,iDACF,CAAC;IAEF,OAAO;QACL,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;IAClD,CAAC;uGAbU,4BAA4B;2FAA5B,4BAA4B,6cAd7B;;GAET;;2FAYU,4BAA4B;kBAhBxC,SAAS;mBAAC;oBACT,QAAQ,EAAE,mCAAmC;oBAC7C,QAAQ,EAAE;;GAET;oBACD,IAAI,EAAE;wBACJ,WAAW,EAAE,wBAAwB;wBACrC,IAAI,EAAE,QAAQ;wBACd,SAAS,EAAE,SAAS;wBACpB,YAAY,EAAE,mBAAmB;wBACjC,cAAc,EAAE,mBAAmB;wBACnC,SAAS,EAAE,WAAW;qBACvB;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n inject,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '@semantic-components/ui';\nimport { SC_EDITOR } from './editor';\n\n@Component({\n selector: 'button[sc-editor-horizontal-rule]',\n template: `\n <ng-content />\n `,\n host: {\n 'data-slot': 'editor-horizontal-rule',\n type: 'button',\n '[class]': 'class()',\n '[disabled]': 'editor.disabled()',\n '[attr.title]': '\"Horizontal line\"',\n '(click)': 'onClick()',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScEditorHorizontalRuleButton {\n readonly editor = inject(SC_EDITOR);\n readonly classInput = input<string>('', { alias: 'class' });\n\n protected readonly class = computed(() =>\n cn(\n 'p-1.5 rounded hover:bg-accent disabled:opacity-50 [&_svg]:size-4',\n this.classInput(),\n ),\n );\n\n onClick(): void {\n this.editor.execCommand('insertHorizontalRule');\n }\n}\n"]}
@@ -0,0 +1,37 @@
1
+ import { Component, ChangeDetectionStrategy, computed, input, inject, ViewEncapsulation, } from '@angular/core';
2
+ import { cn } from '@semantic-components/ui';
3
+ import { SC_EDITOR } from './editor';
4
+ import * as i0 from "@angular/core";
5
+ export class ScEditorItalicButton {
6
+ editor = inject(SC_EDITOR);
7
+ classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
8
+ class = computed(() => cn('p-1.5 rounded hover:bg-accent disabled:opacity-50 [&_svg]:size-4', this.editor.isItalic() && 'bg-accent text-accent-foreground', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
9
+ onClick() {
10
+ this.editor.execCommand('italic');
11
+ }
12
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorItalicButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
13
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.4", type: ScEditorItalicButton, isStandalone: true, selector: "button[sc-editor-italic]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "editor-italic", "type": "button" }, listeners: { "click": "onClick()" }, properties: { "class": "class()", "disabled": "editor.disabled()", "attr.aria-pressed": "editor.isItalic()", "attr.title": "\"Italic (Ctrl+I)\"" } }, ngImport: i0, template: `
14
+ <ng-content />
15
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
16
+ }
17
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorItalicButton, decorators: [{
18
+ type: Component,
19
+ args: [{
20
+ selector: 'button[sc-editor-italic]',
21
+ template: `
22
+ <ng-content />
23
+ `,
24
+ host: {
25
+ 'data-slot': 'editor-italic',
26
+ type: 'button',
27
+ '[class]': 'class()',
28
+ '[disabled]': 'editor.disabled()',
29
+ '[attr.aria-pressed]': 'editor.isItalic()',
30
+ '[attr.title]': '"Italic (Ctrl+I)"',
31
+ '(click)': 'onClick()',
32
+ },
33
+ encapsulation: ViewEncapsulation.None,
34
+ changeDetection: ChangeDetectionStrategy.OnPush,
35
+ }]
36
+ }], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
37
+ //# sourceMappingURL=editor-italic-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-italic-button.js","sourceRoot":"","sources":["../../../../../../../libs/editor/src/lib/components/editor/editor-italic-button.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,QAAQ,EACR,KAAK,EACL,MAAM,EACN,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;;AAmBrC,MAAM,OAAO,oBAAoB;IACtB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC3B,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IAEzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CACA,kEAAkE,EAClE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,kCAAkC,EAC5D,IAAI,CAAC,UAAU,EAAE,CAClB,iDACF,CAAC;IAEF,OAAO;QACL,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;uGAdU,oBAAoB;2FAApB,oBAAoB,qeAfrB;;GAET;;2FAaU,oBAAoB;kBAjBhC,SAAS;mBAAC;oBACT,QAAQ,EAAE,0BAA0B;oBACpC,QAAQ,EAAE;;GAET;oBACD,IAAI,EAAE;wBACJ,WAAW,EAAE,eAAe;wBAC5B,IAAI,EAAE,QAAQ;wBACd,SAAS,EAAE,SAAS;wBACpB,YAAY,EAAE,mBAAmB;wBACjC,qBAAqB,EAAE,mBAAmB;wBAC1C,cAAc,EAAE,mBAAmB;wBACnC,SAAS,EAAE,WAAW;qBACvB;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n inject,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '@semantic-components/ui';\nimport { SC_EDITOR } from './editor';\n\n@Component({\n selector: 'button[sc-editor-italic]',\n template: `\n <ng-content />\n `,\n host: {\n 'data-slot': 'editor-italic',\n type: 'button',\n '[class]': 'class()',\n '[disabled]': 'editor.disabled()',\n '[attr.aria-pressed]': 'editor.isItalic()',\n '[attr.title]': '\"Italic (Ctrl+I)\"',\n '(click)': 'onClick()',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScEditorItalicButton {\n readonly editor = inject(SC_EDITOR);\n readonly classInput = input<string>('', { alias: 'class' });\n\n protected readonly class = computed(() =>\n cn(\n 'p-1.5 rounded hover:bg-accent disabled:opacity-50 [&_svg]:size-4',\n this.editor.isItalic() && 'bg-accent text-accent-foreground',\n this.classInput(),\n ),\n );\n\n onClick(): void {\n this.editor.execCommand('italic');\n }\n}\n"]}
@@ -0,0 +1,52 @@
1
+ import { Component, ChangeDetectionStrategy, computed, input, inject, ViewEncapsulation, } from '@angular/core';
2
+ import { cn } from '@semantic-components/ui';
3
+ import { SC_EDITOR } from './editor';
4
+ import * as i0 from "@angular/core";
5
+ export class ScEditorLinkButton {
6
+ editor = inject(SC_EDITOR);
7
+ classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
8
+ class = computed(() => cn('p-1.5 rounded hover:bg-accent disabled:opacity-50 [&_svg]:size-4', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
9
+ onClick() {
10
+ if (this.editor.disabled() || this.editor.readonly())
11
+ return;
12
+ const selection = window.getSelection();
13
+ const selectedText = selection?.toString() || '';
14
+ const url = prompt('Enter URL:', 'https://');
15
+ if (url) {
16
+ if (selectedText) {
17
+ this.editor.execCommand('createLink', url);
18
+ }
19
+ else {
20
+ const linkText = prompt('Enter link text:', 'Link');
21
+ if (linkText) {
22
+ const link = `<a href="${url}" target="_blank" rel="noopener noreferrer">${linkText}</a>`;
23
+ this.editor.execCommand('insertHTML', link);
24
+ }
25
+ }
26
+ }
27
+ }
28
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorLinkButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
29
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.4", type: ScEditorLinkButton, isStandalone: true, selector: "button[sc-editor-link]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "editor-link", "type": "button" }, listeners: { "click": "onClick()" }, properties: { "class": "class()", "disabled": "editor.disabled()", "attr.title": "\"Insert link (Ctrl+K)\"" } }, ngImport: i0, template: `
30
+ <ng-content />
31
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
32
+ }
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorLinkButton, decorators: [{
34
+ type: Component,
35
+ args: [{
36
+ selector: 'button[sc-editor-link]',
37
+ template: `
38
+ <ng-content />
39
+ `,
40
+ host: {
41
+ 'data-slot': 'editor-link',
42
+ type: 'button',
43
+ '[class]': 'class()',
44
+ '[disabled]': 'editor.disabled()',
45
+ '[attr.title]': '"Insert link (Ctrl+K)"',
46
+ '(click)': 'onClick()',
47
+ },
48
+ encapsulation: ViewEncapsulation.None,
49
+ changeDetection: ChangeDetectionStrategy.OnPush,
50
+ }]
51
+ }], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
52
+ //# sourceMappingURL=editor-link-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-link-button.js","sourceRoot":"","sources":["../../../../../../../libs/editor/src/lib/components/editor/editor-link-button.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,QAAQ,EACR,KAAK,EACL,MAAM,EACN,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;;AAkBrC,MAAM,OAAO,kBAAkB;IACpB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC3B,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IAEzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CACA,kEAAkE,EAClE,IAAI,CAAC,UAAU,EAAE,CAClB,iDACF,CAAC;IAEF,OAAO;QACL,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;YAAE,OAAO;QAE7D,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;QACxC,MAAM,YAAY,GAAG,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAEjD,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QAC7C,IAAI,GAAG,EAAE,CAAC;YACR,IAAI,YAAY,EAAE,CAAC;gBACjB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;YAC7C,CAAC;iBAAM,CAAC;gBACN,MAAM,QAAQ,GAAG,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;gBACpD,IAAI,QAAQ,EAAE,CAAC;oBACb,MAAM,IAAI,GAAG,YAAY,GAAG,+CAA+C,QAAQ,MAAM,CAAC;oBAC1F,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;gBAC9C,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;uGA7BU,kBAAkB;2FAAlB,kBAAkB,4bAdnB;;GAET;;2FAYU,kBAAkB;kBAhB9B,SAAS;mBAAC;oBACT,QAAQ,EAAE,wBAAwB;oBAClC,QAAQ,EAAE;;GAET;oBACD,IAAI,EAAE;wBACJ,WAAW,EAAE,aAAa;wBAC1B,IAAI,EAAE,QAAQ;wBACd,SAAS,EAAE,SAAS;wBACpB,YAAY,EAAE,mBAAmB;wBACjC,cAAc,EAAE,wBAAwB;wBACxC,SAAS,EAAE,WAAW;qBACvB;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n inject,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '@semantic-components/ui';\nimport { SC_EDITOR } from './editor';\n\n@Component({\n selector: 'button[sc-editor-link]',\n template: `\n <ng-content />\n `,\n host: {\n 'data-slot': 'editor-link',\n type: 'button',\n '[class]': 'class()',\n '[disabled]': 'editor.disabled()',\n '[attr.title]': '\"Insert link (Ctrl+K)\"',\n '(click)': 'onClick()',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScEditorLinkButton {\n readonly editor = inject(SC_EDITOR);\n readonly classInput = input<string>('', { alias: 'class' });\n\n protected readonly class = computed(() =>\n cn(\n 'p-1.5 rounded hover:bg-accent disabled:opacity-50 [&_svg]:size-4',\n this.classInput(),\n ),\n );\n\n onClick(): void {\n if (this.editor.disabled() || this.editor.readonly()) return;\n\n const selection = window.getSelection();\n const selectedText = selection?.toString() || '';\n\n const url = prompt('Enter URL:', 'https://');\n if (url) {\n if (selectedText) {\n this.editor.execCommand('createLink', url);\n } else {\n const linkText = prompt('Enter link text:', 'Link');\n if (linkText) {\n const link = `<a href=\"${url}\" target=\"_blank\" rel=\"noopener noreferrer\">${linkText}</a>`;\n this.editor.execCommand('insertHTML', link);\n }\n }\n }\n }\n}\n"]}
@@ -0,0 +1,37 @@
1
+ import { Component, ChangeDetectionStrategy, computed, input, inject, ViewEncapsulation, } from '@angular/core';
2
+ import { cn } from '@semantic-components/ui';
3
+ import { SC_EDITOR } from './editor';
4
+ import * as i0 from "@angular/core";
5
+ export class ScEditorNumberedListButton {
6
+ editor = inject(SC_EDITOR);
7
+ classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
8
+ class = computed(() => cn('p-1.5 rounded hover:bg-accent disabled:opacity-50 [&_svg]:size-4', this.editor.isOrderedList() && 'bg-accent text-accent-foreground', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
9
+ onClick() {
10
+ this.editor.execCommand('insertOrderedList');
11
+ }
12
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorNumberedListButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
13
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.4", type: ScEditorNumberedListButton, isStandalone: true, selector: "button[sc-editor-numbered-list]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "editor-numbered-list", "type": "button" }, listeners: { "click": "onClick()" }, properties: { "class": "class()", "disabled": "editor.disabled()", "attr.aria-pressed": "editor.isOrderedList()", "attr.title": "\"Numbered list\"" } }, ngImport: i0, template: `
14
+ <ng-content />
15
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
16
+ }
17
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorNumberedListButton, decorators: [{
18
+ type: Component,
19
+ args: [{
20
+ selector: 'button[sc-editor-numbered-list]',
21
+ template: `
22
+ <ng-content />
23
+ `,
24
+ host: {
25
+ 'data-slot': 'editor-numbered-list',
26
+ type: 'button',
27
+ '[class]': 'class()',
28
+ '[disabled]': 'editor.disabled()',
29
+ '[attr.aria-pressed]': 'editor.isOrderedList()',
30
+ '[attr.title]': '"Numbered list"',
31
+ '(click)': 'onClick()',
32
+ },
33
+ encapsulation: ViewEncapsulation.None,
34
+ changeDetection: ChangeDetectionStrategy.OnPush,
35
+ }]
36
+ }], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
37
+ //# sourceMappingURL=editor-numbered-list-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-numbered-list-button.js","sourceRoot":"","sources":["../../../../../../../libs/editor/src/lib/components/editor/editor-numbered-list-button.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,QAAQ,EACR,KAAK,EACL,MAAM,EACN,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;;AAmBrC,MAAM,OAAO,0BAA0B;IAC5B,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC3B,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IAEzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CACA,kEAAkE,EAClE,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,IAAI,kCAAkC,EACjE,IAAI,CAAC,UAAU,EAAE,CAClB,iDACF,CAAC;IAEF,OAAO;QACL,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAC/C,CAAC;uGAdU,0BAA0B;2FAA1B,0BAA0B,sfAf3B;;GAET;;2FAaU,0BAA0B;kBAjBtC,SAAS;mBAAC;oBACT,QAAQ,EAAE,iCAAiC;oBAC3C,QAAQ,EAAE;;GAET;oBACD,IAAI,EAAE;wBACJ,WAAW,EAAE,sBAAsB;wBACnC,IAAI,EAAE,QAAQ;wBACd,SAAS,EAAE,SAAS;wBACpB,YAAY,EAAE,mBAAmB;wBACjC,qBAAqB,EAAE,wBAAwB;wBAC/C,cAAc,EAAE,iBAAiB;wBACjC,SAAS,EAAE,WAAW;qBACvB;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n inject,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '@semantic-components/ui';\nimport { SC_EDITOR } from './editor';\n\n@Component({\n selector: 'button[sc-editor-numbered-list]',\n template: `\n <ng-content />\n `,\n host: {\n 'data-slot': 'editor-numbered-list',\n type: 'button',\n '[class]': 'class()',\n '[disabled]': 'editor.disabled()',\n '[attr.aria-pressed]': 'editor.isOrderedList()',\n '[attr.title]': '\"Numbered list\"',\n '(click)': 'onClick()',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScEditorNumberedListButton {\n readonly editor = inject(SC_EDITOR);\n readonly classInput = input<string>('', { alias: 'class' });\n\n protected readonly class = computed(() =>\n cn(\n 'p-1.5 rounded hover:bg-accent disabled:opacity-50 [&_svg]:size-4',\n this.editor.isOrderedList() && 'bg-accent text-accent-foreground',\n this.classInput(),\n ),\n );\n\n onClick(): void {\n this.editor.execCommand('insertOrderedList');\n }\n}\n"]}
@@ -0,0 +1,36 @@
1
+ import { Component, ChangeDetectionStrategy, computed, input, inject, ViewEncapsulation, } from '@angular/core';
2
+ import { cn } from '@semantic-components/ui';
3
+ import { SC_EDITOR } from './editor';
4
+ import * as i0 from "@angular/core";
5
+ export class ScEditorRedoButton {
6
+ editor = inject(SC_EDITOR);
7
+ classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
8
+ class = computed(() => cn('p-1.5 rounded hover:bg-accent disabled:opacity-50 [&_svg]:size-4', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
9
+ onClick() {
10
+ this.editor.execCommand('redo');
11
+ }
12
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorRedoButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
13
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.4", type: ScEditorRedoButton, isStandalone: true, selector: "button[sc-editor-redo]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "editor-redo", "type": "button" }, listeners: { "click": "onClick()" }, properties: { "class": "class()", "disabled": "editor.disabled() || !editor.canRedo()", "attr.title": "\"Redo (Ctrl+Y)\"" } }, ngImport: i0, template: `
14
+ <ng-content />
15
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
16
+ }
17
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorRedoButton, decorators: [{
18
+ type: Component,
19
+ args: [{
20
+ selector: 'button[sc-editor-redo]',
21
+ template: `
22
+ <ng-content />
23
+ `,
24
+ host: {
25
+ 'data-slot': 'editor-redo',
26
+ type: 'button',
27
+ '[class]': 'class()',
28
+ '[disabled]': 'editor.disabled() || !editor.canRedo()',
29
+ '[attr.title]': '"Redo (Ctrl+Y)"',
30
+ '(click)': 'onClick()',
31
+ },
32
+ encapsulation: ViewEncapsulation.None,
33
+ changeDetection: ChangeDetectionStrategy.OnPush,
34
+ }]
35
+ }], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
36
+ //# sourceMappingURL=editor-redo-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-redo-button.js","sourceRoot":"","sources":["../../../../../../../libs/editor/src/lib/components/editor/editor-redo-button.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,QAAQ,EACR,KAAK,EACL,MAAM,EACN,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;;AAkBrC,MAAM,OAAO,kBAAkB;IACpB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC3B,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IAEzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CACA,kEAAkE,EAClE,IAAI,CAAC,UAAU,EAAE,CAClB,iDACF,CAAC;IAEF,OAAO;QACL,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;uGAbU,kBAAkB;2FAAlB,kBAAkB,0cAdnB;;GAET;;2FAYU,kBAAkB;kBAhB9B,SAAS;mBAAC;oBACT,QAAQ,EAAE,wBAAwB;oBAClC,QAAQ,EAAE;;GAET;oBACD,IAAI,EAAE;wBACJ,WAAW,EAAE,aAAa;wBAC1B,IAAI,EAAE,QAAQ;wBACd,SAAS,EAAE,SAAS;wBACpB,YAAY,EAAE,wCAAwC;wBACtD,cAAc,EAAE,iBAAiB;wBACjC,SAAS,EAAE,WAAW;qBACvB;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n inject,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '@semantic-components/ui';\nimport { SC_EDITOR } from './editor';\n\n@Component({\n selector: 'button[sc-editor-redo]',\n template: `\n <ng-content />\n `,\n host: {\n 'data-slot': 'editor-redo',\n type: 'button',\n '[class]': 'class()',\n '[disabled]': 'editor.disabled() || !editor.canRedo()',\n '[attr.title]': '\"Redo (Ctrl+Y)\"',\n '(click)': 'onClick()',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScEditorRedoButton {\n readonly editor = inject(SC_EDITOR);\n readonly classInput = input<string>('', { alias: 'class' });\n\n protected readonly class = computed(() =>\n cn(\n 'p-1.5 rounded hover:bg-accent disabled:opacity-50 [&_svg]:size-4',\n this.classInput(),\n ),\n );\n\n onClick(): void {\n this.editor.execCommand('redo');\n }\n}\n"]}
@@ -0,0 +1,23 @@
1
+ import { Component, ChangeDetectionStrategy, computed, input, ViewEncapsulation, } from '@angular/core';
2
+ import { cn } from '@semantic-components/ui';
3
+ import * as i0 from "@angular/core";
4
+ export class ScEditorSeparator {
5
+ classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
6
+ class = computed(() => cn('w-px h-6 bg-border mx-1', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
7
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorSeparator, deps: [], target: i0.ɵɵFactoryTarget.Component });
8
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.4", type: ScEditorSeparator, isStandalone: true, selector: "div[sc-editor-separator]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "editor-separator" }, properties: { "class": "class()" } }, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
9
+ }
10
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorSeparator, decorators: [{
11
+ type: Component,
12
+ args: [{
13
+ selector: 'div[sc-editor-separator]',
14
+ template: ``,
15
+ host: {
16
+ 'data-slot': 'editor-separator',
17
+ '[class]': 'class()',
18
+ },
19
+ encapsulation: ViewEncapsulation.None,
20
+ changeDetection: ChangeDetectionStrategy.OnPush,
21
+ }]
22
+ }], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
23
+ //# sourceMappingURL=editor-separator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-separator.js","sourceRoot":"","sources":["../../../../../../../libs/editor/src/lib/components/editor/editor-separator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,QAAQ,EACR,KAAK,EACL,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;;AAY7C,MAAM,OAAO,iBAAiB;IACnB,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IACzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CAAC,yBAAyB,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,iDACjD,CAAC;uGAJS,iBAAiB;2FAAjB,iBAAiB,iUARlB,EAAE;;2FAQD,iBAAiB;kBAV7B,SAAS;mBAAC;oBACT,QAAQ,EAAE,0BAA0B;oBACpC,QAAQ,EAAE,EAAE;oBACZ,IAAI,EAAE;wBACJ,WAAW,EAAE,kBAAkB;wBAC/B,SAAS,EAAE,SAAS;qBACrB;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '@semantic-components/ui';\n\n@Component({\n selector: 'div[sc-editor-separator]',\n template: ``,\n host: {\n 'data-slot': 'editor-separator',\n '[class]': 'class()',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScEditorSeparator {\n readonly classInput = input<string>('', { alias: 'class' });\n protected readonly class = computed(() =>\n cn('w-px h-6 bg-border mx-1', this.classInput()),\n );\n}\n"]}
@@ -0,0 +1,37 @@
1
+ import { Component, ChangeDetectionStrategy, computed, input, inject, ViewEncapsulation, } from '@angular/core';
2
+ import { cn } from '@semantic-components/ui';
3
+ import { SC_EDITOR } from './editor';
4
+ import * as i0 from "@angular/core";
5
+ export class ScEditorStrikethroughButton {
6
+ editor = inject(SC_EDITOR);
7
+ classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
8
+ class = computed(() => cn('p-1.5 rounded hover:bg-accent disabled:opacity-50 [&_svg]:size-4', this.editor.isStrikethrough() && 'bg-accent text-accent-foreground', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
9
+ onClick() {
10
+ this.editor.execCommand('strikethrough');
11
+ }
12
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorStrikethroughButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
13
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.4", type: ScEditorStrikethroughButton, isStandalone: true, selector: "button[sc-editor-strikethrough]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "editor-strikethrough", "type": "button" }, listeners: { "click": "onClick()" }, properties: { "class": "class()", "disabled": "editor.disabled()", "attr.aria-pressed": "editor.isStrikethrough()", "attr.title": "\"Strikethrough\"" } }, ngImport: i0, template: `
14
+ <ng-content />
15
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
16
+ }
17
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorStrikethroughButton, decorators: [{
18
+ type: Component,
19
+ args: [{
20
+ selector: 'button[sc-editor-strikethrough]',
21
+ template: `
22
+ <ng-content />
23
+ `,
24
+ host: {
25
+ 'data-slot': 'editor-strikethrough',
26
+ type: 'button',
27
+ '[class]': 'class()',
28
+ '[disabled]': 'editor.disabled()',
29
+ '[attr.aria-pressed]': 'editor.isStrikethrough()',
30
+ '[attr.title]': '"Strikethrough"',
31
+ '(click)': 'onClick()',
32
+ },
33
+ encapsulation: ViewEncapsulation.None,
34
+ changeDetection: ChangeDetectionStrategy.OnPush,
35
+ }]
36
+ }], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
37
+ //# sourceMappingURL=editor-strikethrough-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-strikethrough-button.js","sourceRoot":"","sources":["../../../../../../../libs/editor/src/lib/components/editor/editor-strikethrough-button.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,QAAQ,EACR,KAAK,EACL,MAAM,EACN,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;;AAmBrC,MAAM,OAAO,2BAA2B;IAC7B,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC3B,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IAEzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CACA,kEAAkE,EAClE,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,IAAI,kCAAkC,EACnE,IAAI,CAAC,UAAU,EAAE,CAClB,iDACF,CAAC;IAEF,OAAO;QACL,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAC3C,CAAC;uGAdU,2BAA2B;2FAA3B,2BAA2B,wfAf5B;;GAET;;2FAaU,2BAA2B;kBAjBvC,SAAS;mBAAC;oBACT,QAAQ,EAAE,iCAAiC;oBAC3C,QAAQ,EAAE;;GAET;oBACD,IAAI,EAAE;wBACJ,WAAW,EAAE,sBAAsB;wBACnC,IAAI,EAAE,QAAQ;wBACd,SAAS,EAAE,SAAS;wBACpB,YAAY,EAAE,mBAAmB;wBACjC,qBAAqB,EAAE,0BAA0B;wBACjD,cAAc,EAAE,iBAAiB;wBACjC,SAAS,EAAE,WAAW;qBACvB;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n inject,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '@semantic-components/ui';\nimport { SC_EDITOR } from './editor';\n\n@Component({\n selector: 'button[sc-editor-strikethrough]',\n template: `\n <ng-content />\n `,\n host: {\n 'data-slot': 'editor-strikethrough',\n type: 'button',\n '[class]': 'class()',\n '[disabled]': 'editor.disabled()',\n '[attr.aria-pressed]': 'editor.isStrikethrough()',\n '[attr.title]': '\"Strikethrough\"',\n '(click)': 'onClick()',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScEditorStrikethroughButton {\n readonly editor = inject(SC_EDITOR);\n readonly classInput = input<string>('', { alias: 'class' });\n\n protected readonly class = computed(() =>\n cn(\n 'p-1.5 rounded hover:bg-accent disabled:opacity-50 [&_svg]:size-4',\n this.editor.isStrikethrough() && 'bg-accent text-accent-foreground',\n this.classInput(),\n ),\n );\n\n onClick(): void {\n this.editor.execCommand('strikethrough');\n }\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import { Component, ChangeDetectionStrategy, computed, input, ViewEncapsulation, } from '@angular/core';
2
+ import { cn } from '@semantic-components/ui';
3
+ import * as i0 from "@angular/core";
4
+ export class ScEditorToolbarGroup {
5
+ classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
6
+ class = computed(() => cn('flex items-center gap-1', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
7
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorToolbarGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
8
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.4", type: ScEditorToolbarGroup, isStandalone: true, selector: "div[sc-editor-toolbar-group]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "editor-toolbar-group" }, properties: { "class": "class()" } }, ngImport: i0, template: `
9
+ <ng-content />
10
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
11
+ }
12
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorToolbarGroup, decorators: [{
13
+ type: Component,
14
+ args: [{
15
+ selector: 'div[sc-editor-toolbar-group]',
16
+ template: `
17
+ <ng-content />
18
+ `,
19
+ host: {
20
+ 'data-slot': 'editor-toolbar-group',
21
+ '[class]': 'class()',
22
+ },
23
+ encapsulation: ViewEncapsulation.None,
24
+ changeDetection: ChangeDetectionStrategy.OnPush,
25
+ }]
26
+ }], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
27
+ //# sourceMappingURL=editor-toolbar-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-toolbar-group.js","sourceRoot":"","sources":["../../../../../../../libs/editor/src/lib/components/editor/editor-toolbar-group.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,QAAQ,EACR,KAAK,EACL,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;;AAc7C,MAAM,OAAO,oBAAoB;IACtB,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IACzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CAAC,yBAAyB,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,iDACjD,CAAC;uGAJS,oBAAoB;2FAApB,oBAAoB,yUAVrB;;GAET;;2FAQU,oBAAoB;kBAZhC,SAAS;mBAAC;oBACT,QAAQ,EAAE,8BAA8B;oBACxC,QAAQ,EAAE;;GAET;oBACD,IAAI,EAAE;wBACJ,WAAW,EAAE,sBAAsB;wBACnC,SAAS,EAAE,SAAS;qBACrB;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '@semantic-components/ui';\n\n@Component({\n selector: 'div[sc-editor-toolbar-group]',\n template: `\n <ng-content />\n `,\n host: {\n 'data-slot': 'editor-toolbar-group',\n '[class]': 'class()',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScEditorToolbarGroup {\n readonly classInput = input<string>('', { alias: 'class' });\n protected readonly class = computed(() =>\n cn('flex items-center gap-1', this.classInput()),\n );\n}\n"]}
@@ -0,0 +1,29 @@
1
+ import { Component, ChangeDetectionStrategy, computed, input, ViewEncapsulation, } from '@angular/core';
2
+ import { cn } from '@semantic-components/ui';
3
+ import * as i0 from "@angular/core";
4
+ export class ScEditorToolbar {
5
+ classInput = input('', { ...(ngDevMode ? { debugName: "classInput" } : {}), alias: 'class' });
6
+ class = computed(() => cn('flex flex-wrap items-center gap-1 p-2 border-b bg-muted/30', this.classInput()), ...(ngDevMode ? [{ debugName: "class" }] : []));
7
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorToolbar, deps: [], target: i0.ɵɵFactoryTarget.Component });
8
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.4", type: ScEditorToolbar, isStandalone: true, selector: "div[sc-editor-toolbar]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "editor-toolbar", "role": "toolbar" }, properties: { "attr.aria-label": "\"Text formatting\"", "class": "class()" } }, ngImport: i0, template: `
9
+ <ng-content />
10
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
11
+ }
12
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScEditorToolbar, decorators: [{
13
+ type: Component,
14
+ args: [{
15
+ selector: 'div[sc-editor-toolbar]',
16
+ template: `
17
+ <ng-content />
18
+ `,
19
+ host: {
20
+ 'data-slot': 'editor-toolbar',
21
+ role: 'toolbar',
22
+ '[attr.aria-label]': '"Text formatting"',
23
+ '[class]': 'class()',
24
+ },
25
+ encapsulation: ViewEncapsulation.None,
26
+ changeDetection: ChangeDetectionStrategy.OnPush,
27
+ }]
28
+ }], propDecorators: { classInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
29
+ //# sourceMappingURL=editor-toolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-toolbar.js","sourceRoot":"","sources":["../../../../../../../libs/editor/src/lib/components/editor/editor-toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,QAAQ,EACR,KAAK,EACL,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;;AAgB7C,MAAM,OAAO,eAAe;IACjB,UAAU,GAAG,KAAK,CAAS,EAAE,uDAAI,KAAK,EAAE,OAAO,GAAG,CAAC;IACzC,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CACvC,EAAE,CACA,4DAA4D,EAC5D,IAAI,CAAC,UAAU,EAAE,CAClB,iDACF,CAAC;uGAPS,eAAe;2FAAf,eAAe,0XAZhB;;GAET;;2FAUU,eAAe;kBAd3B,SAAS;mBAAC;oBACT,QAAQ,EAAE,wBAAwB;oBAClC,QAAQ,EAAE;;GAET;oBACD,IAAI,EAAE;wBACJ,WAAW,EAAE,gBAAgB;wBAC7B,IAAI,EAAE,SAAS;wBACf,mBAAmB,EAAE,mBAAmB;wBACxC,SAAS,EAAE,SAAS;qBACrB;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { cn } from '@semantic-components/ui';\n\n@Component({\n selector: 'div[sc-editor-toolbar]',\n template: `\n <ng-content />\n `,\n host: {\n 'data-slot': 'editor-toolbar',\n role: 'toolbar',\n '[attr.aria-label]': '\"Text formatting\"',\n '[class]': 'class()',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ScEditorToolbar {\n readonly classInput = input<string>('', { alias: 'class' });\n protected readonly class = computed(() =>\n cn(\n 'flex flex-wrap items-center gap-1 p-2 border-b bg-muted/30',\n this.classInput(),\n ),\n );\n}\n"]}