@progress/kendo-angular-conversational-ui 24.0.0-develop.1 → 24.0.0-develop.11

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 (20) hide show
  1. package/NOTICE.txt +2599 -172
  2. package/codemods/{utils.js → libs/common/src/codemods/utils.js} +53 -30
  3. package/codemods/{v20 → libs/conversational-ui/codemods/v20}/aiprompt-rendering-changes.js +4 -4
  4. package/codemods/{v20 → libs/conversational-ui/codemods/v20}/chat-messageboxtype.js +5 -27
  5. package/codemods/{v20 → libs/conversational-ui/codemods/v20}/chat-rendering-changes.js +8 -8
  6. package/codemods/{v20 → libs/conversational-ui/codemods/v20}/chat-user.js +6 -28
  7. package/codemods/{v21 → libs/conversational-ui/codemods/v21}/chat-message-id-required.js +6 -6
  8. package/codemods/{v21 → libs/conversational-ui/codemods/v21}/chat-messagetoolbarvisibility.js +6 -28
  9. package/codemods/{v21 → libs/conversational-ui/codemods/v21}/chat-pinnedbyfield.js +2 -2
  10. package/codemods/{v21 → libs/conversational-ui/codemods/v21}/chat-rendering-changes.js +12 -12
  11. package/codemods/{v23 → libs/conversational-ui/codemods/v23}/chat-FileSelectSettings.js +3 -3
  12. package/codemods/{v23 → libs/conversational-ui/codemods/v23}/chat-enableFileSelect.js +6 -28
  13. package/codemods/libs/conversational-ui/codemods/v23/chat-enableSpeechToText.js +30 -0
  14. package/codemods/{v23 → libs/conversational-ui/codemods/v23}/chat-rendering-changes.js +16 -16
  15. package/codemods/libs/conversational-ui/codemods/v23/customMessages-send.js +30 -0
  16. package/fesm2022/progress-kendo-angular-conversational-ui.mjs +2 -2
  17. package/package-metadata.mjs +2 -2
  18. package/package.json +22 -30
  19. package/codemods/v23/chat-enableSpeechToText.js +0 -52
  20. package/codemods/v23/customMessages-send.js +0 -52
@@ -3,29 +3,6 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  "use strict";
6
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- var desc = Object.getOwnPropertyDescriptor(m, k);
9
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
- desc = { enumerable: true, get: function() { return m[k]; } };
11
- }
12
- Object.defineProperty(o, k2, desc);
13
- }) : (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- o[k2] = m[k];
16
- }));
17
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
- Object.defineProperty(o, "default", { enumerable: true, value: v });
19
- }) : function(o, v) {
20
- o["default"] = v;
21
- });
22
- var __importStar = (this && this.__importStar) || function (mod) {
23
- if (mod && mod.__esModule) return mod;
24
- var result = {};
25
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
- __setModuleDefault(result, mod);
27
- return result;
28
- };
29
6
  Object.defineProperty(exports, "__esModule", { value: true });
30
7
  exports.tsInterfaceTransformer = exports.tsPropertyValueTransformer = exports.tsPropertyTransformer = exports.tsComponentPropertyRemoval = exports.attributeRemoval = exports.attributeValueUpdate = exports.attributeNameValueUpdate = exports.attributeNameUpdate = exports.eventUpdate = exports.htmlTransformer = exports.blockTextElements = void 0;
31
8
  exports.hasKendoInTemplate = hasKendoInTemplate;
@@ -35,8 +12,12 @@ exports.makePattern = makePattern;
35
12
  exports.writeInstructionMarker = writeInstructionMarker;
36
13
  exports.isApiChangeTarget = isApiChangeTarget;
37
14
  exports.isRenderingChangeTarget = isRenderingChangeTarget;
38
- const fs = __importStar(require("node:fs"));
39
- const path = __importStar(require("node:path"));
15
+ exports.executeCodemodTest = executeCodemodTest;
16
+ const tslib_1 = require("tslib");
17
+ /// <reference types="node" />
18
+ const fs = tslib_1.__importStar(require("fs"));
19
+ const os = tslib_1.__importStar(require("os"));
20
+ const path = tslib_1.__importStar(require("path"));
40
21
  exports.blockTextElements = {
41
22
  script: true,
42
23
  noscript: true,
@@ -320,12 +301,12 @@ const attributeRemoval = (templateContent, tagName, attributeName, propertyToRem
320
301
  // If no propertyToRemove is specified, remove the entire attribute
321
302
  if (!propertyToRemove) {
322
303
  // Remove bound attributes [attribute]="value"
323
- const boundAttributePattern = new RegExp(`(\\s+)\\[${escapedAttr}\\]\\s*=\\s*("(?:[^"\\\\]|\\\\.)*?"|'(?:[^'\\\\]|\\\\.)*?'|[^\\s>]+)`, 'gi');
304
+ const boundAttributePattern = new RegExp(`(<${escapedTag}[^>]*?)\\s+\\[${escapedAttr}\\]\\s*=\\s*("(?:[^"\\\\]|\\\\.)*?"|'(?:[^'\\\\]|\\\\.)*?'|[^\\s>]+)([^>]*?>)`, 'gi');
324
305
  // Remove static attributes attribute="value"
325
- const staticAttributePattern = new RegExp(`(\\s+)${escapedAttr}\\s*=\\s*("(?:[^"\\\\]|\\\\.)*?"|'(?:[^'\\\\]|\\\\.)*?'|[^\\s>]+)`, 'gi');
326
- // Apply removals
327
- let result = templateContent.replace(boundAttributePattern, '');
328
- result = result.replace(staticAttributePattern, '');
306
+ const staticAttributePattern = new RegExp(`(<${escapedTag}[^>]*?)\\s+${escapedAttr}\\s*=\\s*("(?:[^"\\\\]|\\\\.)*?"|'(?:[^'\\\\]|\\\\.)*?'|[^\\s>]+)([^>]*?>)`, 'gi');
307
+ // Apply removals - keep tag prefix and suffix, remove the attribute
308
+ let result = templateContent.replace(boundAttributePattern, '$1$3');
309
+ result = result.replace(staticAttributePattern, '$1$3');
329
310
  return result;
330
311
  }
331
312
  // Remove specific property from object literal attributes
@@ -1428,3 +1409,45 @@ function isRenderingChangeTarget(filePath) {
1428
1409
  const ext = path.extname(filePath);
1429
1410
  return ext === '.ts' || ext === '.html' || ext === '.css' || ext === '.scss' || ext === '.sass' || ext === '.less';
1430
1411
  }
1412
+ /**
1413
+ * Executes a codemod transformation and compares the result with expected output
1414
+ *
1415
+ * @param codemod - The codemod function to execute
1416
+ * @param testDir - Directory containing the test files (__dirname from test file)
1417
+ * @param exampleFileName - Name of the input file (default: 'example.ts')
1418
+ * @param expectedFileName - Name of the expected output file (default: 'expected.ts')
1419
+ * @returns Object containing the transformation result and expected content
1420
+ */
1421
+ function executeCodemodTest(codemod, testDir, exampleFileName = 'example.ts', expectedFileName = 'expected.ts') {
1422
+ const exampleFile = path.join(testDir, exampleFileName);
1423
+ const expectedFile = path.join(testDir, expectedFileName);
1424
+ const sourceCode = fs.readFileSync(exampleFile, 'utf-8');
1425
+ const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'codemod-test-'));
1426
+ const tmpFile = path.join(tmpDir, path.basename(exampleFile));
1427
+ fs.writeFileSync(tmpFile, sourceCode, 'utf-8');
1428
+ try {
1429
+ const fileInfo = {
1430
+ path: tmpFile,
1431
+ source: sourceCode
1432
+ };
1433
+ const jscodeshift = require('jscodeshift').withParser('tsx');
1434
+ const api = {
1435
+ jscodeshift,
1436
+ j: jscodeshift
1437
+ };
1438
+ const result = codemod(fileInfo, api);
1439
+ const expectedContent = fs.readFileSync(expectedFile, 'utf-8').trim();
1440
+ return {
1441
+ result: result?.trim(),
1442
+ expected: expectedContent,
1443
+ sourceCode,
1444
+ transformedSuccessfully: result !== undefined
1445
+ };
1446
+ }
1447
+ finally {
1448
+ try {
1449
+ fs.rmSync(tmpDir, { recursive: true });
1450
+ }
1451
+ catch { }
1452
+ }
1453
+ }
@@ -6,15 +6,15 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.aiInstructions = void 0;
8
8
  exports.default = default_1;
9
- const utils_1 = require("../utils");
9
+ const codemods_1 = require("@progress/kendo-angular-common/codemods");
10
10
  exports.aiInstructions = `Review your stylesheets, test files, and any code that references the k-prompt-suggestion class. It has been replaced with k-suggestion on each suggestion element.
11
11
  Replace .k-prompt-suggestion selectors with .k-suggestion in your styles and tests.`;
12
12
  const classes = ['k-prompt-suggestion'];
13
- const pattern = (0, utils_1.makePattern)(classes);
13
+ const pattern = (0, codemods_1.makePattern)(classes);
14
14
  function default_1(fileInfo) {
15
- if ((0, utils_1.isRenderingChangeTarget)(fileInfo.path)) {
15
+ if ((0, codemods_1.isRenderingChangeTarget)(fileInfo.path)) {
16
16
  if (pattern.test(fileInfo.source)) {
17
- (0, utils_1.writeInstructionMarker)(exports.aiInstructions, __filename, fileInfo.path);
17
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructions, __filename, fileInfo.path);
18
18
  }
19
19
  }
20
20
  return fileInfo.source;
@@ -3,34 +3,12 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  "use strict";
6
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- var desc = Object.getOwnPropertyDescriptor(m, k);
9
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
- desc = { enumerable: true, get: function() { return m[k]; } };
11
- }
12
- Object.defineProperty(o, k2, desc);
13
- }) : (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- o[k2] = m[k];
16
- }));
17
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
- Object.defineProperty(o, "default", { enumerable: true, value: v });
19
- }) : function(o, v) {
20
- o["default"] = v;
21
- });
22
- var __importStar = (this && this.__importStar) || function (mod) {
23
- if (mod && mod.__esModule) return mod;
24
- var result = {};
25
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
- __setModuleDefault(result, mod);
27
- return result;
28
- };
29
6
  Object.defineProperty(exports, "__esModule", { value: true });
30
7
  exports.aiInstructions = void 0;
31
8
  exports.default = default_1;
32
- const fs = __importStar(require("fs"));
33
- const utils_1 = require("../utils");
9
+ const tslib_1 = require("tslib");
10
+ const fs = tslib_1.__importStar(require("fs"));
11
+ const codemods_1 = require("@progress/kendo-angular-common/codemods");
34
12
  // Matches messageBoxType="textbox" or [messageBoxType]="'textbox'" on kendo-chat
35
13
  const textboxPattern = /kendo-chat[^>]*messageBoxType[^>]*("|')textbox\1/;
36
14
  function removeTextboxMessageBoxType(templateContent) {
@@ -42,10 +20,10 @@ function removeTextboxMessageBoxType(templateContent) {
42
20
  }
43
21
  function default_1(fileInfo, api) {
44
22
  const filePath = fileInfo.path;
45
- if (!(0, utils_1.isApiChangeTarget)(filePath)) {
23
+ if (!(0, codemods_1.isApiChangeTarget)(filePath)) {
46
24
  return fileInfo.source;
47
25
  }
48
- const htmlResult = (0, utils_1.htmlTransformer)(fileInfo, api, (templateContent) => {
26
+ const htmlResult = (0, codemods_1.htmlTransformer)(fileInfo, api, (templateContent) => {
49
27
  if (textboxPattern.test(templateContent)) {
50
28
  return removeTextboxMessageBoxType(templateContent);
51
29
  }
@@ -6,7 +6,7 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.aiInstructions = exports.aiInstructionsAvatarImage = exports.aiInstructionsQuickReply = exports.aiInstructionsQuickReplies = void 0;
8
8
  exports.default = default_1;
9
- const utils_1 = require("../utils");
9
+ const codemods_1 = require("@progress/kendo-angular-common/codemods");
10
10
  exports.aiInstructionsQuickReplies = `CSS class k-quick-replies — replaced with k-suggestion-group on the suggested actions of the Chat.
11
11
  Replace .k-quick-replies selectors with .k-suggestion-group in your styles and tests.`;
12
12
  exports.aiInstructionsQuickReply = `CSS class k-quick-reply — replaced with k-suggestion k-suggestion-primary on each chat suggestion.
@@ -23,21 +23,21 @@ ${exports.aiInstructionsQuickReply}
23
23
 
24
24
  ${exports.aiInstructionsAvatarImage}`;
25
25
  const classesQuickReplies = ['k-quick-replies'];
26
- const patternQuickReplies = (0, utils_1.makePattern)(classesQuickReplies);
26
+ const patternQuickReplies = (0, codemods_1.makePattern)(classesQuickReplies);
27
27
  const classesQuickReply = ['k-quick-reply'];
28
- const patternQuickReply = (0, utils_1.makePattern)(classesQuickReply);
28
+ const patternQuickReply = (0, codemods_1.makePattern)(classesQuickReply);
29
29
  const classesAvatarImage = ['k-avatar-image', 'k-message-group-content'];
30
- const patternAvatarImage = (0, utils_1.makePattern)(classesAvatarImage);
30
+ const patternAvatarImage = (0, codemods_1.makePattern)(classesAvatarImage);
31
31
  function default_1(fileInfo) {
32
- if ((0, utils_1.isRenderingChangeTarget)(fileInfo.path)) {
32
+ if ((0, codemods_1.isRenderingChangeTarget)(fileInfo.path)) {
33
33
  if (patternQuickReplies.test(fileInfo.source)) {
34
- (0, utils_1.writeInstructionMarker)(exports.aiInstructionsQuickReplies, __filename, fileInfo.path);
34
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructionsQuickReplies, __filename, fileInfo.path);
35
35
  }
36
36
  if (patternQuickReply.test(fileInfo.source)) {
37
- (0, utils_1.writeInstructionMarker)(exports.aiInstructionsQuickReply, __filename, fileInfo.path);
37
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructionsQuickReply, __filename, fileInfo.path);
38
38
  }
39
39
  if (patternAvatarImage.test(fileInfo.source)) {
40
- (0, utils_1.writeInstructionMarker)(exports.aiInstructionsAvatarImage, __filename, fileInfo.path);
40
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructionsAvatarImage, __filename, fileInfo.path);
41
41
  }
42
42
  }
43
43
  return fileInfo.source;
@@ -3,41 +3,19 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  "use strict";
6
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- var desc = Object.getOwnPropertyDescriptor(m, k);
9
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
- desc = { enumerable: true, get: function() { return m[k]; } };
11
- }
12
- Object.defineProperty(o, k2, desc);
13
- }) : (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- o[k2] = m[k];
16
- }));
17
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
- Object.defineProperty(o, "default", { enumerable: true, value: v });
19
- }) : function(o, v) {
20
- o["default"] = v;
21
- });
22
- var __importStar = (this && this.__importStar) || function (mod) {
23
- if (mod && mod.__esModule) return mod;
24
- var result = {};
25
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
- __setModuleDefault(result, mod);
27
- return result;
28
- };
29
6
  Object.defineProperty(exports, "__esModule", { value: true });
30
7
  exports.aiInstructions = void 0;
31
8
  exports.default = default_1;
32
- const fs = __importStar(require("fs"));
33
- const utils_1 = require("../utils");
9
+ const tslib_1 = require("tslib");
10
+ const fs = tslib_1.__importStar(require("fs"));
11
+ const codemods_1 = require("@progress/kendo-angular-common/codemods");
34
12
  function default_1(fileInfo, api) {
35
13
  const filePath = fileInfo.path;
36
- if (!(0, utils_1.isApiChangeTarget)(filePath)) {
14
+ if (!(0, codemods_1.isApiChangeTarget)(filePath)) {
37
15
  return fileInfo.source;
38
16
  }
39
17
  // Handle HTML files and inline templates
40
- const htmlResult = (0, utils_1.htmlTransformer)(fileInfo, api, (templateContent) => (0, utils_1.attributeNameValueUpdate)(templateContent, 'kendo-chat', 'user', 'authorId', 'id'));
18
+ const htmlResult = (0, codemods_1.htmlTransformer)(fileInfo, api, (templateContent) => (0, codemods_1.attributeNameValueUpdate)(templateContent, 'kendo-chat', 'user', 'authorId', 'id'));
41
19
  if (filePath.endsWith('.html')) {
42
20
  if (htmlResult && htmlResult !== fileInfo.source) {
43
21
  fs.writeFileSync(filePath, htmlResult, 'utf-8');
@@ -48,7 +26,7 @@ function default_1(fileInfo, api) {
48
26
  // Handle TypeScript property transformations
49
27
  const j = api.jscodeshift;
50
28
  const rootSource = j(htmlResult || fileInfo.source);
51
- (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, '@progress/kendo-angular-conversational-ui', 'ChatComponent', 'user', 'authorId', 'id');
29
+ (0, codemods_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, '@progress/kendo-angular-conversational-ui', 'ChatComponent', 'user', 'authorId', 'id');
52
30
  return rootSource.toSource();
53
31
  }
54
32
  exports.aiInstructions = `The Chat's user input property is renamed to authorId, and its value type changed — it now expects the user's ID directly instead of a user object.
@@ -6,22 +6,22 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.aiInstructions = void 0;
8
8
  exports.default = default_1;
9
- const utils_1 = require("../utils");
9
+ const codemods_1 = require("@progress/kendo-angular-common/codemods");
10
10
  // Matches <kendo-chat ... [messages]="..." ...>
11
11
  const chatMessagesPattern = /<kendo-chat[^>]*\[messages\]/;
12
12
  function default_1(fileInfo, api) {
13
13
  const filePath = fileInfo.path;
14
- if (!(0, utils_1.isApiChangeTarget)(filePath)) {
14
+ if (!(0, codemods_1.isApiChangeTarget)(filePath)) {
15
15
  return fileInfo.source;
16
16
  }
17
17
  if (filePath.endsWith('.html')) {
18
18
  if (chatMessagesPattern.test(fileInfo.source)) {
19
- (0, utils_1.writeInstructionMarker)(exports.aiInstructions, __filename, fileInfo.path);
19
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructions, __filename, fileInfo.path);
20
20
  }
21
21
  return fileInfo.source;
22
22
  }
23
23
  let patternDetected = false;
24
- (0, utils_1.htmlTransformer)(fileInfo, api, (templateContent) => {
24
+ (0, codemods_1.htmlTransformer)(fileInfo, api, (templateContent) => {
25
25
  if (chatMessagesPattern.test(templateContent)) {
26
26
  patternDetected = true;
27
27
  }
@@ -29,9 +29,9 @@ function default_1(fileInfo, api) {
29
29
  });
30
30
  const j = api.jscodeshift;
31
31
  const rootSource = j(fileInfo.source);
32
- const hasMessageImport = (0, utils_1.isImportedFromPackage)(rootSource, j, '@progress/kendo-angular-conversational-ui', 'Message');
32
+ const hasMessageImport = (0, codemods_1.isImportedFromPackage)(rootSource, j, '@progress/kendo-angular-conversational-ui', 'Message');
33
33
  if (patternDetected || hasMessageImport) {
34
- (0, utils_1.writeInstructionMarker)(exports.aiInstructions, __filename, fileInfo.path);
34
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructions, __filename, fileInfo.path);
35
35
  }
36
36
  return fileInfo.source;
37
37
  }
@@ -3,41 +3,19 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  "use strict";
6
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- var desc = Object.getOwnPropertyDescriptor(m, k);
9
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
- desc = { enumerable: true, get: function() { return m[k]; } };
11
- }
12
- Object.defineProperty(o, k2, desc);
13
- }) : (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- o[k2] = m[k];
16
- }));
17
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
- Object.defineProperty(o, "default", { enumerable: true, value: v });
19
- }) : function(o, v) {
20
- o["default"] = v;
21
- });
22
- var __importStar = (this && this.__importStar) || function (mod) {
23
- if (mod && mod.__esModule) return mod;
24
- var result = {};
25
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
- __setModuleDefault(result, mod);
27
- return result;
28
- };
29
6
  Object.defineProperty(exports, "__esModule", { value: true });
30
7
  exports.aiInstructions = void 0;
31
8
  exports.default = default_1;
32
- const fs = __importStar(require("fs"));
33
- const utils_1 = require("../utils");
9
+ const tslib_1 = require("tslib");
10
+ const fs = tslib_1.__importStar(require("fs"));
11
+ const codemods_1 = require("@progress/kendo-angular-common/codemods");
34
12
  function default_1(fileInfo, api) {
35
13
  const filePath = fileInfo.path;
36
- if (!(0, utils_1.isApiChangeTarget)(filePath)) {
14
+ if (!(0, codemods_1.isApiChangeTarget)(filePath)) {
37
15
  return fileInfo.source;
38
16
  }
39
17
  // Handle HTML files and inline templates
40
- const htmlResult = (0, utils_1.htmlTransformer)(fileInfo, api, (templateContent) => (0, utils_1.attributeRemoval)(templateContent, 'kendo-chat', 'messageToolbarVisibility'));
18
+ const htmlResult = (0, codemods_1.htmlTransformer)(fileInfo, api, (templateContent) => (0, codemods_1.attributeRemoval)(templateContent, 'kendo-chat', 'messageToolbarVisibility'));
41
19
  if (filePath.endsWith('.html')) {
42
20
  if (htmlResult && htmlResult !== fileInfo.source) {
43
21
  fs.writeFileSync(filePath, htmlResult, 'utf-8');
@@ -48,7 +26,7 @@ function default_1(fileInfo, api) {
48
26
  // Handle TypeScript property transformations
49
27
  const j = api.jscodeshift;
50
28
  const rootSource = j(htmlResult || fileInfo.source);
51
- (0, utils_1.tsComponentPropertyRemoval)(fileInfo.source, rootSource, j, '@progress/kendo-angular-conversational-ui', 'ChatComponent', 'messageToolbarVisibility');
29
+ (0, codemods_1.tsComponentPropertyRemoval)(fileInfo.source, rootSource, j, '@progress/kendo-angular-conversational-ui', 'ChatComponent', 'messageToolbarVisibility');
52
30
  return rootSource.toSource();
53
31
  }
54
32
  exports.aiInstructions = `The message toolbar is now shown automatically only when messageToolbarActions are configured.
@@ -5,7 +5,7 @@
5
5
  "use strict";
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.default = default_1;
8
- const utils_1 = require("../utils");
8
+ const codemods_1 = require("@progress/kendo-angular-common/codemods");
9
9
  function default_1(fileInfo, api) {
10
10
  const filePath = fileInfo.path;
11
11
  if (filePath.endsWith('.html')) {
@@ -13,6 +13,6 @@ function default_1(fileInfo, api) {
13
13
  }
14
14
  const j = api.jscodeshift;
15
15
  const rootSource = j(fileInfo.source);
16
- (0, utils_1.tsPropertyRemoval)(fileInfo.source, rootSource, j, '@progress/kendo-angular-conversational-ui', 'ConversationalUIModelFields', 'pinnedByField');
16
+ (0, codemods_1.tsPropertyRemoval)(fileInfo.source, rootSource, j, '@progress/kendo-angular-conversational-ui', 'ConversationalUIModelFields', 'pinnedByField');
17
17
  return rootSource.toSource();
18
18
  }
@@ -6,7 +6,7 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.aiInstructions = exports.aiInstructionsMessageReference = exports.aiInstructionsIconXxl = exports.aiInstructionsAppbarLight = exports.aiInstructionsFirstLast = exports.aiInstructionsAvatars = void 0;
8
8
  exports.default = default_1;
9
- const utils_1 = require("../utils");
9
+ const codemods_1 = require("@progress/kendo-angular-common/codemods");
10
10
  exports.aiInstructionsAvatars = `k-avatars — removed from the k-message-list element.
11
11
  Remove any CSS rules or selectors that target .k-message-list.k-avatars or rely on k-avatars being present on k-message-list.`;
12
12
  exports.aiInstructionsFirstLast = `k-first / k-last — removed from the k-message element.
@@ -31,31 +31,31 @@ ${exports.aiInstructionsIconXxl}
31
31
 
32
32
  ${exports.aiInstructionsMessageReference}`;
33
33
  const classesAvatars = ['k-avatars'];
34
- const patternAvatars = (0, utils_1.makePattern)(classesAvatars);
34
+ const patternAvatars = (0, codemods_1.makePattern)(classesAvatars);
35
35
  const classesFirstLast = ['k-first', 'k-last'];
36
- const patternFirstLast = (0, utils_1.makePattern)(classesFirstLast);
36
+ const patternFirstLast = (0, codemods_1.makePattern)(classesFirstLast);
37
37
  const classesAppbarLight = ['k-appbar-light'];
38
- const patternAppbarLight = (0, utils_1.makePattern)(classesAppbarLight);
38
+ const patternAppbarLight = (0, codemods_1.makePattern)(classesAppbarLight);
39
39
  const classesIconXxl = ['k-icon-xxl'];
40
- const patternIconXxl = (0, utils_1.makePattern)(classesIconXxl);
40
+ const patternIconXxl = (0, codemods_1.makePattern)(classesIconXxl);
41
41
  const classesMessageReference = ['k-message-reference', 'k-message-reference-receiver', 'k-chat-bubble-text', 'k-bubble-content'];
42
- const patternMessageReference = (0, utils_1.makePattern)(classesMessageReference);
42
+ const patternMessageReference = (0, codemods_1.makePattern)(classesMessageReference);
43
43
  function default_1(fileInfo) {
44
- if ((0, utils_1.isRenderingChangeTarget)(fileInfo.path)) {
44
+ if ((0, codemods_1.isRenderingChangeTarget)(fileInfo.path)) {
45
45
  if (patternAvatars.test(fileInfo.source)) {
46
- (0, utils_1.writeInstructionMarker)(exports.aiInstructionsAvatars, __filename, fileInfo.path);
46
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructionsAvatars, __filename, fileInfo.path);
47
47
  }
48
48
  if (patternFirstLast.test(fileInfo.source)) {
49
- (0, utils_1.writeInstructionMarker)(exports.aiInstructionsFirstLast, __filename, fileInfo.path);
49
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructionsFirstLast, __filename, fileInfo.path);
50
50
  }
51
51
  if (patternAppbarLight.test(fileInfo.source)) {
52
- (0, utils_1.writeInstructionMarker)(exports.aiInstructionsAppbarLight, __filename, fileInfo.path);
52
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructionsAppbarLight, __filename, fileInfo.path);
53
53
  }
54
54
  if (patternIconXxl.test(fileInfo.source)) {
55
- (0, utils_1.writeInstructionMarker)(exports.aiInstructionsIconXxl, __filename, fileInfo.path);
55
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructionsIconXxl, __filename, fileInfo.path);
56
56
  }
57
57
  if (patternMessageReference.test(fileInfo.source)) {
58
- (0, utils_1.writeInstructionMarker)(exports.aiInstructionsMessageReference, __filename, fileInfo.path);
58
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructionsMessageReference, __filename, fileInfo.path);
59
59
  }
60
60
  }
61
61
  return fileInfo.source;
@@ -5,14 +5,14 @@
5
5
  "use strict";
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.default = default_1;
8
- const utils_1 = require("../utils");
8
+ const codemods_1 = require("@progress/kendo-angular-common/codemods");
9
9
  function default_1(fileInfo, api) {
10
- if (!(0, utils_1.isApiChangeTarget)(fileInfo.path)) {
10
+ if (!(0, codemods_1.isApiChangeTarget)(fileInfo.path)) {
11
11
  return fileInfo.source;
12
12
  }
13
13
  const j = api.jscodeshift;
14
14
  const rootSource = j(fileInfo.source);
15
- (0, utils_1.tsInterfaceTransformer)(fileInfo, rootSource, j, '@progress/kendo-angular-upload', 'FileSelectSettings', 'FileSelectButtonSettings');
15
+ (0, codemods_1.tsInterfaceTransformer)(fileInfo, rootSource, j, '@progress/kendo-angular-upload', 'FileSelectSettings', 'FileSelectButtonSettings');
16
16
  // Update import statement from @progress/kendo-angular-upload to @progress/kendo-angular-conversational-ui
17
17
  rootSource.find(j.ImportDeclaration, {
18
18
  source: { value: '@progress/kendo-angular-upload' }
@@ -3,41 +3,19 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  "use strict";
6
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- var desc = Object.getOwnPropertyDescriptor(m, k);
9
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
- desc = { enumerable: true, get: function() { return m[k]; } };
11
- }
12
- Object.defineProperty(o, k2, desc);
13
- }) : (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- o[k2] = m[k];
16
- }));
17
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
- Object.defineProperty(o, "default", { enumerable: true, value: v });
19
- }) : function(o, v) {
20
- o["default"] = v;
21
- });
22
- var __importStar = (this && this.__importStar) || function (mod) {
23
- if (mod && mod.__esModule) return mod;
24
- var result = {};
25
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
- __setModuleDefault(result, mod);
27
- return result;
28
- };
29
6
  Object.defineProperty(exports, "__esModule", { value: true });
30
7
  exports.aiInstructions = void 0;
31
8
  exports.default = default_1;
32
- const fs = __importStar(require("fs"));
33
- const utils_1 = require("../utils");
9
+ const tslib_1 = require("tslib");
10
+ const fs = tslib_1.__importStar(require("fs"));
11
+ const codemods_1 = require("@progress/kendo-angular-common/codemods");
34
12
  function default_1(fileInfo, api) {
35
13
  const filePath = fileInfo.path;
36
- if (!(0, utils_1.isApiChangeTarget)(filePath)) {
14
+ if (!(0, codemods_1.isApiChangeTarget)(filePath)) {
37
15
  return fileInfo.source;
38
16
  }
39
17
  // Handle HTML files and inline templates
40
- const htmlResult = (0, utils_1.htmlTransformer)(fileInfo, api, (templateContent) => (0, utils_1.attributeNameUpdate)(templateContent, 'kendo-chat', 'enableFileSelect', 'fileSelectButton'));
18
+ const htmlResult = (0, codemods_1.htmlTransformer)(fileInfo, api, (templateContent) => (0, codemods_1.attributeNameUpdate)(templateContent, 'kendo-chat', 'enableFileSelect', 'fileSelectButton'));
41
19
  if (filePath.endsWith('.html')) {
42
20
  if (htmlResult && htmlResult !== fileInfo.source) {
43
21
  fs.writeFileSync(filePath, htmlResult, 'utf-8');
@@ -48,7 +26,7 @@ function default_1(fileInfo, api) {
48
26
  // Handle TypeScript property transformations
49
27
  const j = api.jscodeshift;
50
28
  const rootSource = j(htmlResult || fileInfo.source);
51
- (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, '@progress/kendo-angular-conversational-ui', 'ChatComponent', 'enableFileSelect', 'fileSelectButton');
29
+ (0, codemods_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, '@progress/kendo-angular-conversational-ui', 'ChatComponent', 'enableFileSelect', 'fileSelectButton');
52
30
  return rootSource.toSource();
53
31
  }
54
32
  exports.aiInstructions = `The new property \`fileSelectButton\` accepts a FileSelectButtonSettings object for finer control over the button.
@@ -0,0 +1,30 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ "use strict";
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.default = default_1;
8
+ const tslib_1 = require("tslib");
9
+ const fs = tslib_1.__importStar(require("fs"));
10
+ const codemods_1 = require("@progress/kendo-angular-common/codemods");
11
+ function default_1(fileInfo, api) {
12
+ const filePath = fileInfo.path;
13
+ if (!(0, codemods_1.isApiChangeTarget)(filePath)) {
14
+ return fileInfo.source;
15
+ }
16
+ // Handle HTML files and inline templates
17
+ const htmlResult = (0, codemods_1.htmlTransformer)(fileInfo, api, (templateContent) => (0, codemods_1.attributeNameUpdate)(templateContent, 'kendo-chat', 'enableSpeechToText', 'speechToTextButton'));
18
+ if (filePath.endsWith('.html')) {
19
+ if (htmlResult && htmlResult !== fileInfo.source) {
20
+ fs.writeFileSync(filePath, htmlResult, 'utf-8');
21
+ return htmlResult;
22
+ }
23
+ return fileInfo.source; // Return original source if no changes
24
+ }
25
+ // Handle TypeScript property transformations
26
+ const j = api.jscodeshift;
27
+ const rootSource = j(htmlResult || fileInfo.source);
28
+ (0, codemods_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, '@progress/kendo-angular-conversational-ui', 'ChatComponent', 'enableSpeechToText', 'speechToTextButton');
29
+ return rootSource.toSource();
30
+ }
@@ -6,7 +6,7 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.aiInstructions = exports.aiInstructionsMessageTime = exports.aiInstructionsMessagePinned = exports.aiInstructionsAppbar = exports.aiInstructionsChatFile = exports.aiInstructionsChatFileSize = exports.aiInstructionsChatFileName = exports.aiInstructionsChatFileInfo = void 0;
8
8
  exports.default = default_1;
9
- const utils_1 = require("../utils");
9
+ const codemods_1 = require("@progress/kendo-angular-common/codemods");
10
10
  exports.aiInstructionsChatFileInfo = `k-chat-file-info — replaced with k-file-info.
11
11
  Replace .k-chat-file-info selectors with .k-file-info in your styles and tests.`;
12
12
  exports.aiInstructionsChatFileName = `k-chat-file-name — replaced with k-file-name.
@@ -37,41 +37,41 @@ ${exports.aiInstructionsMessagePinned}
37
37
 
38
38
  ${exports.aiInstructionsMessageTime}`;
39
39
  const classesChatFileInfo = ['k-chat-file-info'];
40
- const patternChatFileInfo = (0, utils_1.makePattern)(classesChatFileInfo);
40
+ const patternChatFileInfo = (0, codemods_1.makePattern)(classesChatFileInfo);
41
41
  const classesChatFileName = ['k-chat-file-name'];
42
- const patternChatFileName = (0, utils_1.makePattern)(classesChatFileName);
42
+ const patternChatFileName = (0, codemods_1.makePattern)(classesChatFileName);
43
43
  const classesChatFileSize = ['k-chat-file-size'];
44
- const patternChatFileSize = (0, utils_1.makePattern)(classesChatFileSize);
44
+ const patternChatFileSize = (0, codemods_1.makePattern)(classesChatFileSize);
45
45
  const classesChatFile = ['k-chat-file'];
46
- const patternChatFile = (0, utils_1.makePattern)(classesChatFile);
46
+ const patternChatFile = (0, codemods_1.makePattern)(classesChatFile);
47
47
  const classesAppbar = ['k-appbar'];
48
- const patternAppbar = (0, utils_1.makePattern)(classesAppbar);
48
+ const patternAppbar = (0, codemods_1.makePattern)(classesAppbar);
49
49
  const classesMessagePinned = ['k-message-pinned'];
50
- const patternMessagePinned = (0, utils_1.makePattern)(classesMessagePinned);
50
+ const patternMessagePinned = (0, codemods_1.makePattern)(classesMessagePinned);
51
51
  const classesMessageTime = ['k-message-time'];
52
- const patternMessageTime = (0, utils_1.makePattern)(classesMessageTime);
52
+ const patternMessageTime = (0, codemods_1.makePattern)(classesMessageTime);
53
53
  function default_1(fileInfo) {
54
- if ((0, utils_1.isRenderingChangeTarget)(fileInfo.path)) {
54
+ if ((0, codemods_1.isRenderingChangeTarget)(fileInfo.path)) {
55
55
  if (patternChatFileInfo.test(fileInfo.source)) {
56
- (0, utils_1.writeInstructionMarker)(exports.aiInstructionsChatFileInfo, __filename, fileInfo.path);
56
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructionsChatFileInfo, __filename, fileInfo.path);
57
57
  }
58
58
  if (patternChatFileName.test(fileInfo.source)) {
59
- (0, utils_1.writeInstructionMarker)(exports.aiInstructionsChatFileName, __filename, fileInfo.path);
59
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructionsChatFileName, __filename, fileInfo.path);
60
60
  }
61
61
  if (patternChatFileSize.test(fileInfo.source)) {
62
- (0, utils_1.writeInstructionMarker)(exports.aiInstructionsChatFileSize, __filename, fileInfo.path);
62
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructionsChatFileSize, __filename, fileInfo.path);
63
63
  }
64
64
  if (patternChatFile.test(fileInfo.source)) {
65
- (0, utils_1.writeInstructionMarker)(exports.aiInstructionsChatFile, __filename, fileInfo.path);
65
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructionsChatFile, __filename, fileInfo.path);
66
66
  }
67
67
  if (patternAppbar.test(fileInfo.source)) {
68
- (0, utils_1.writeInstructionMarker)(exports.aiInstructionsAppbar, __filename, fileInfo.path);
68
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructionsAppbar, __filename, fileInfo.path);
69
69
  }
70
70
  if (patternMessagePinned.test(fileInfo.source)) {
71
- (0, utils_1.writeInstructionMarker)(exports.aiInstructionsMessagePinned, __filename, fileInfo.path);
71
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructionsMessagePinned, __filename, fileInfo.path);
72
72
  }
73
73
  if (patternMessageTime.test(fileInfo.source)) {
74
- (0, utils_1.writeInstructionMarker)(exports.aiInstructionsMessageTime, __filename, fileInfo.path);
74
+ (0, codemods_1.writeInstructionMarker)(exports.aiInstructionsMessageTime, __filename, fileInfo.path);
75
75
  }
76
76
  }
77
77
  return fileInfo.source;