@eui/core 21.0.0-alpha.9 → 21.0.0-next.10

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 (121) hide show
  1. package/CHANGELOG.md +799 -5265
  2. package/docs/changelog.html +947 -7522
  3. package/docs/classes/ActivatedRouteAction.html +18 -0
  4. package/docs/classes/AddApiQueueItemAction.html +18 -0
  5. package/docs/classes/AddAppLoadedConfigModulesAction.html +18 -0
  6. package/docs/classes/ApiQueueServiceMock.html +18 -0
  7. package/docs/classes/AsyncStorageService.html +18 -0
  8. package/docs/classes/AsyncStorageServiceMock.html +18 -0
  9. package/docs/classes/CssUtils.html +45 -0
  10. package/docs/classes/EmptyApiQueueAction.html +18 -0
  11. package/docs/classes/ErrorSubClass.html +18 -0
  12. package/docs/classes/EuiCoreRootGuardClass.html +18 -0
  13. package/docs/classes/EuiError.html +18 -0
  14. package/docs/classes/I18nResourceImpl.html +18 -0
  15. package/docs/classes/InitStoreAction.html +18 -0
  16. package/docs/classes/LogServiceMock.html +18 -0
  17. package/docs/classes/RemoveApiQueueItemAction.html +18 -0
  18. package/docs/classes/StorageService.html +18 -0
  19. package/docs/classes/StorageServiceMock.html +18 -0
  20. package/docs/classes/TranslateServiceMock.html +18 -0
  21. package/docs/classes/UpdateAppConnectionAction.html +18 -0
  22. package/docs/classes/UpdateAppStatusAction.html +18 -0
  23. package/docs/classes/UpdateAppVersionAction.html +18 -0
  24. package/docs/classes/UpdateCurrentModuleAction.html +18 -0
  25. package/docs/classes/UpdateI18nStateAction.html +18 -0
  26. package/docs/classes/UpdateLocaleStateAction.html +18 -0
  27. package/docs/classes/UpdateNotificationsListAction.html +18 -0
  28. package/docs/classes/UpdateUserDashboardAction.html +18 -0
  29. package/docs/classes/UpdateUserDetailsAction.html +18 -0
  30. package/docs/classes/UpdateUserPreferencesAction.html +18 -0
  31. package/docs/classes/UpdateUserRightsAction.html +18 -0
  32. package/docs/classes/UpdateUserStateAction.html +18 -0
  33. package/docs/dependencies.html +18 -0
  34. package/docs/directives/TranslateMockDirective.html +18 -0
  35. package/docs/index.html +20 -2
  36. package/docs/injectables/ApiQueueService.html +18 -0
  37. package/docs/injectables/EuiAppShellService.html +55 -0
  38. package/docs/injectables/EuiDynamicComponentService.html +18 -0
  39. package/docs/injectables/EuiDynamicMenuService.html +18 -0
  40. package/docs/injectables/EuiGrowlService.html +18 -0
  41. package/docs/injectables/EuiLoaderService.html +18 -0
  42. package/docs/injectables/EuiPermissionService.html +18 -0
  43. package/docs/injectables/EuiThemeService.html +18 -0
  44. package/docs/injectables/EuiTimezoneService.html +18 -0
  45. package/docs/injectables/GlobalErrorHandler.html +18 -0
  46. package/docs/injectables/I18nLoader.html +18 -0
  47. package/docs/injectables/I18nService.html +18 -0
  48. package/docs/injectables/I18nServiceMock.html +18 -0
  49. package/docs/injectables/LocalForageService.html +18 -0
  50. package/docs/injectables/LocalStorageService.html +18 -0
  51. package/docs/injectables/LocaleService.html +18 -0
  52. package/docs/injectables/LocaleServiceMock.html +18 -0
  53. package/docs/injectables/LogService.html +18 -0
  54. package/docs/injectables/SessionStorageService.html +18 -0
  55. package/docs/injectables/StoreService.html +18 -0
  56. package/docs/injectables/StoreServiceMock.html +18 -0
  57. package/docs/injectables/UserService.html +18 -0
  58. package/docs/injectables/UserServiceMock.html +18 -0
  59. package/docs/interceptors/AddLangParamInterceptor.html +18 -0
  60. package/docs/interceptors/CachePreventionInterceptor.html +18 -0
  61. package/docs/interceptors/CorsSecurityInterceptor.html +18 -0
  62. package/docs/interceptors/CsrfPreventionInterceptor.html +18 -0
  63. package/docs/interceptors/EuLoginSessionTimeoutHandlingInterceptor.html +18 -0
  64. package/docs/interceptors/HttpErrorHandlerInterceptor.html +18 -0
  65. package/docs/interceptors/UxRequestErrorModelInterceptor.html +18 -0
  66. package/docs/interfaces/Action.html +18 -0
  67. package/docs/interfaces/ActionReducer.html +18 -0
  68. package/docs/interfaces/Dependency.html +18 -0
  69. package/docs/interfaces/EuiTimeZone.html +18 -0
  70. package/docs/interfaces/IEuiTheme.html +18 -0
  71. package/docs/interfaces/Library.html +18 -0
  72. package/docs/interfaces/LoadedResources.html +18 -0
  73. package/docs/interfaces/LoadedResourcesError.html +18 -0
  74. package/docs/interfaces/MemoizedSelector.html +18 -0
  75. package/docs/interfaces/MemoizedSelectorWithProps.html +18 -0
  76. package/docs/interfaces/ModuleLoadEvent.html +18 -0
  77. package/docs/interfaces/Policy.html +18 -0
  78. package/docs/interfaces/ResourceError.html +18 -0
  79. package/docs/interfaces/ThemeState.html +18 -0
  80. package/docs/interfaces/TranslationKeys.html +18 -0
  81. package/docs/interfaces/UIState.html +108 -0
  82. package/docs/interfaces/body.html +18 -0
  83. package/docs/js/libs/bootstrap-native.js +1 -1
  84. package/docs/js/libs/jszip.min.js +13 -0
  85. package/docs/js/libs/svg-pan-zoom.min.js +3 -3
  86. package/docs/js/libs/tablesort.min.js +3 -3
  87. package/docs/js/libs/tablesort.number.min.js +3 -3
  88. package/docs/js/menu-wc.js +16 -20
  89. package/docs/js/menu-wc_es5.js +1 -1
  90. package/docs/js/routes/routes_index.js +1 -0
  91. package/docs/js/routes.js +15 -8
  92. package/docs/js/search/search_index.js +2 -2
  93. package/docs/license.html +20 -2
  94. package/docs/miscellaneous/enumerations.html +18 -0
  95. package/docs/miscellaneous/functions.html +18 -0
  96. package/docs/miscellaneous/typealiases.html +18 -0
  97. package/docs/miscellaneous/variables.html +48 -53
  98. package/docs/modules/CoreModule.html +18 -0
  99. package/docs/modules/I18nModule.html +18 -0
  100. package/docs/modules/LogModule.html +18 -0
  101. package/docs/modules/TranslateMockModule.html +18 -0
  102. package/docs/modules.html +18 -0
  103. package/docs/overview.html +28 -0
  104. package/docs/pipes/TranslateMockPipe.html +18 -0
  105. package/docs/properties.html +19 -1
  106. package/docs/routes.html +204 -0
  107. package/docs/template-playground/default-templates.json +192 -0
  108. package/docs/template-playground/hbs-render.service.ts +212 -0
  109. package/docs/template-playground/main.ts +9 -0
  110. package/docs/template-playground/template-editor.service.ts +173 -0
  111. package/docs/template-playground/template-playground.component.ts +614 -0
  112. package/docs/template-playground/template-playground.module.ts +29 -0
  113. package/docs/template-playground/zip-export.service.ts +86 -0
  114. package/docs/template-playground-app/app.js +1389 -0
  115. package/docs/template-playground-app/index.html +462 -0
  116. package/fesm2022/eui-core.mjs +150 -110
  117. package/fesm2022/eui-core.mjs.map +1 -1
  118. package/package.json +44 -45
  119. package/{index.d.ts → types/eui-core.d.ts} +13 -1
  120. package/types/eui-core.d.ts.map +1 -0
  121. package/index.d.ts.map +0 -1
@@ -0,0 +1,173 @@
1
+ import { Injectable } from '@angular/core';
2
+
3
+ declare const monaco: any;
4
+
5
+ @Injectable({
6
+ providedIn: 'root'
7
+ })
8
+ export class TemplateEditorService {
9
+ private editor: any;
10
+ private onChangeCallback: ((value: string) => void) | null = null;
11
+
12
+ initializeEditor(container: HTMLElement) {
13
+ // Initialize Monaco Editor
14
+ this.editor = monaco.editor.create(container, {
15
+ value: '',
16
+ language: 'html',
17
+ theme: 'vs-dark',
18
+ automaticLayout: true,
19
+ minimap: {
20
+ enabled: true
21
+ },
22
+ scrollBeyondLastLine: false,
23
+ fontSize: 14,
24
+ wordWrap: 'on',
25
+ lineNumbers: 'on',
26
+ roundedSelection: false,
27
+ scrollbar: {
28
+ horizontal: 'visible',
29
+ vertical: 'visible'
30
+ },
31
+ overviewRulerLanes: 2,
32
+ quickSuggestions: {
33
+ other: true,
34
+ comments: true,
35
+ strings: true
36
+ },
37
+ parameterHints: {
38
+ enabled: true
39
+ },
40
+ autoClosingBrackets: 'always',
41
+ autoClosingQuotes: 'always',
42
+ suggestOnTriggerCharacters: true,
43
+ acceptSuggestionOnEnter: 'on',
44
+ tabCompletion: 'on',
45
+ wordBasedSuggestions: false
46
+ });
47
+
48
+ // Set up change listener
49
+ this.editor.onDidChangeModelContent(() => {
50
+ if (this.onChangeCallback) {
51
+ this.onChangeCallback(this.editor.getValue());
52
+ }
53
+ });
54
+
55
+ // Register custom language definitions
56
+ this.registerHandlebarsLanguage();
57
+ }
58
+
59
+ setEditorContent(content: string, fileType: string) {
60
+ if (this.editor) {
61
+ const language = this.getLanguageFromFileType(fileType);
62
+ const model = monaco.editor.createModel(content, language);
63
+ this.editor.setModel(model);
64
+ }
65
+ }
66
+
67
+ setOnChangeCallback(callback: (value: string) => void) {
68
+ this.onChangeCallback = callback;
69
+ }
70
+
71
+ private getLanguageFromFileType(fileType: string): string {
72
+ switch (fileType) {
73
+ case 'hbs':
74
+ return 'handlebars';
75
+ case 'css':
76
+ case 'scss':
77
+ return 'css';
78
+ case 'js':
79
+ return 'javascript';
80
+ case 'ts':
81
+ return 'typescript';
82
+ default:
83
+ return 'html';
84
+ }
85
+ }
86
+
87
+ private registerHandlebarsLanguage() {
88
+ // Register Handlebars language for Monaco Editor
89
+ if (monaco.languages.getLanguages().find((lang: any) => lang.id === 'handlebars')) {
90
+ return; // Already registered
91
+ }
92
+
93
+ monaco.languages.register({ id: 'handlebars' });
94
+
95
+ monaco.languages.setMonarchTokensProvider('handlebars', {
96
+ tokenizer: {
97
+ root: [
98
+ [/\{\{\{/, { token: 'keyword', next: '@handlebars_unescaped' }],
99
+ [/\{\{/, { token: 'keyword', next: '@handlebars' }],
100
+ [/<!DOCTYPE/, 'metatag', '@doctype'],
101
+ [/<!--/, 'comment', '@comment'],
102
+ [/(<)(\w+)/, ['delimiter', { token: 'tag', next: '@tag' }]],
103
+ [/(<\/)(\w+)/, ['delimiter', { token: 'tag', next: '@tag' }]],
104
+ [/</, 'delimiter'],
105
+ [/[^<]+/]
106
+ ],
107
+
108
+ handlebars_unescaped: [
109
+ [/\}\}\}/, { token: 'keyword', next: '@pop' }],
110
+ [/[^}]+/, 'variable']
111
+ ],
112
+
113
+ handlebars: [
114
+ [/\}\}/, { token: 'keyword', next: '@pop' }],
115
+ [/#if|#unless|#each|#with|\/if|\/unless|\/each|\/with/, 'keyword'],
116
+ [/[a-zA-Z_][\w]*/, 'variable'],
117
+ [/[^}]+/, 'variable']
118
+ ],
119
+
120
+ comment: [
121
+ [/-->/, 'comment', '@pop'],
122
+ [/[^-]+/, 'comment'],
123
+ [/./, 'comment']
124
+ ],
125
+
126
+ doctype: [
127
+ [/[^>]+/, 'metatag.content'],
128
+ [/>/, 'metatag', '@pop']
129
+ ],
130
+
131
+ tag: [
132
+ [/[ \t\r\n]+/, 'white'],
133
+ [/(\w+)(\s*=\s*)("([^"]*)")/, ['attribute.name', 'delimiter', 'attribute.value', 'attribute.value']],
134
+ [/(\w+)(\s*=\s*)('([^']*)')/, ['attribute.name', 'delimiter', 'attribute.value', 'attribute.value']],
135
+ [/\w+/, 'attribute.name'],
136
+ [/>/, 'delimiter', '@pop']
137
+ ]
138
+ }
139
+ });
140
+
141
+ monaco.languages.setLanguageConfiguration('handlebars', {
142
+ comments: {
143
+ blockComment: ['<!--', '-->']
144
+ },
145
+ brackets: [
146
+ ['<', '>'],
147
+ ['{{', '}}'],
148
+ ['{{{', '}}}']
149
+ ],
150
+ autoClosingPairs: [
151
+ { open: '<', close: '>' },
152
+ { open: '{{', close: '}}' },
153
+ { open: '{{{', close: '}}}' },
154
+ { open: '"', close: '"' },
155
+ { open: "'", close: "'" }
156
+ ],
157
+ surroundingPairs: [
158
+ { open: '<', close: '>' },
159
+ { open: '{{', close: '}}' },
160
+ { open: '{{{', close: '}}}' },
161
+ { open: '"', close: '"' },
162
+ { open: "'", close: "'" }
163
+ ]
164
+ });
165
+ }
166
+
167
+ destroy() {
168
+ if (this.editor) {
169
+ this.editor.dispose();
170
+ this.editor = null;
171
+ }
172
+ }
173
+ }