@alfresco/adf-core 8.0.2 → 8.0.3

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.
@@ -15,15 +15,13 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import { FocusableOption } from '@angular/cdk/a11y';
18
- import { ElementRef, OnInit } from '@angular/core';
19
- import { DomSanitizer } from '@angular/platform-browser';
18
+ import { OnInit } from '@angular/core';
20
19
  import * as i0 from "@angular/core";
21
20
  export declare class PdfThumbComponent implements OnInit, FocusableOption {
22
- private sanitizer;
23
- private element;
21
+ private readonly sanitizer;
22
+ private readonly element;
24
23
  page: any;
25
24
  image$: Promise<string>;
26
- constructor(sanitizer: DomSanitizer, element: ElementRef);
27
25
  ngOnInit(): void;
28
26
  focus(): void;
29
27
  private getThumb;
@@ -1,9 +1,9 @@
1
- import { AfterViewInit, ElementRef, EventEmitter, OnDestroy, OnInit, QueryList } from '@angular/core';
1
+ import { AfterViewInit, EventEmitter, OnDestroy, OnInit, QueryList } from '@angular/core';
2
2
  import { PdfThumbComponent } from '../pdf-viewer-thumb/pdf-viewer-thumb.component';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class PdfThumbListComponent implements OnInit, AfterViewInit, OnDestroy {
5
- private element;
6
- private document;
5
+ private readonly element;
6
+ private readonly document;
7
7
  pdfViewer: any;
8
8
  close: EventEmitter<void>;
9
9
  virtualHeight: number;
@@ -12,7 +12,7 @@ export declare class PdfThumbListComponent implements OnInit, AfterViewInit, OnD
12
12
  width: number;
13
13
  currentHeight: number;
14
14
  private items;
15
- private margin;
15
+ private readonly margin;
16
16
  private itemHeight;
17
17
  private previouslyFocusedElement;
18
18
  private keyManager;
@@ -20,15 +20,13 @@ export declare class PdfThumbListComponent implements OnInit, AfterViewInit, OnD
20
20
  thumbsList: QueryList<PdfThumbComponent>;
21
21
  onKeydown(event: KeyboardEvent): void;
22
22
  onResize(): void;
23
- constructor(element: ElementRef, document: any);
24
23
  ngOnInit(): void;
25
24
  ngAfterViewInit(): void;
26
25
  ngOnDestroy(): void;
27
- trackByFn(_: number, item: any): number;
28
26
  isSelected(pageNumber: number): boolean;
29
27
  goTo(pageNumber: number): void;
30
28
  scrollInto(pageNumber: number): void;
31
- getPages(): any;
29
+ getPages(): any[];
32
30
  private setHeight;
33
31
  private calculateHeight;
34
32
  private calculateItems;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alfresco/adf-core",
3
3
  "description": "Alfresco ADF core",
4
- "version": "8.0.2",
4
+ "version": "8.0.3",
5
5
  "author": "Hyland Software, Inc. and its affiliates",
6
6
  "repository": {
7
7
  "type": "git",
@@ -0,0 +1,24 @@
1
+ /*!
2
+ * @license
3
+ * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { Rule, Tree } from '@angular-devkit/schematics';
18
+ import { Project } from 'ts-morph';
19
+ /**
20
+ * @returns Schematic rule for updating imports
21
+ */
22
+ export declare function updateAlfrescoApiImports(): Rule;
23
+ export declare const visitor: (filePath: string, tree: Pick<Tree, "read" | "overwrite">, project: Project) => void;
24
+ export default updateAlfrescoApiImports;
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ /*!
3
+ * @license
4
+ * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.visitor = void 0;
20
+ exports.updateAlfrescoApiImports = updateAlfrescoApiImports;
21
+ const schematics_1 = require("@angular-devkit/schematics");
22
+ const ts_morph_1 = require("ts-morph");
23
+ const alfrescoApiServiceMigration = {
24
+ change: {
25
+ importedValue: 'AlfrescoApiService',
26
+ importSource: '@alfresco/adf-core'
27
+ },
28
+ to: {
29
+ importedValue: 'AlfrescoApiService',
30
+ importSource: '@alfresco/adf-content-services'
31
+ }
32
+ };
33
+ const alfrescoApiMockMigration = {
34
+ change: {
35
+ importedValue: 'AlfrescoApiServiceMock',
36
+ importSource: '@alfresco/adf-core'
37
+ },
38
+ to: {
39
+ importedValue: 'AlfrescoApiServiceMock',
40
+ importSource: '@alfresco/adf-content-services'
41
+ }
42
+ };
43
+ const alfrescoApiFactoryMigration = {
44
+ change: {
45
+ importedValue: 'AlfrescoApiFactory',
46
+ importSource: '@alfresco/adf-core'
47
+ },
48
+ to: {
49
+ importedValue: 'AlfrescoApiFactory',
50
+ importSource: '@alfresco/adf-content-services'
51
+ }
52
+ };
53
+ const migrations = [alfrescoApiServiceMigration, alfrescoApiMockMigration, alfrescoApiFactoryMigration];
54
+ /**
55
+ * @returns Schematic rule for updating imports
56
+ */
57
+ function updateAlfrescoApiImports() {
58
+ const project = new ts_morph_1.Project();
59
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
60
+ return (tree, _context) => {
61
+ tree.visit((filePath) => (0, exports.visitor)(filePath, tree, project));
62
+ return tree;
63
+ };
64
+ }
65
+ const visitor = (filePath, tree, project) => {
66
+ if (!filePath.includes('/.git/') &&
67
+ !filePath.includes('/node_modules/') &&
68
+ !filePath.includes('/.angular/') &&
69
+ !filePath.includes('/.nxcache/') &&
70
+ /\.ts$/.test(filePath)) {
71
+ const bufferFileContent = tree.read(filePath);
72
+ if (!bufferFileContent) {
73
+ throw new schematics_1.SchematicsException(`Could not read file: ${filePath}`);
74
+ }
75
+ migrations.forEach((migrationData) => {
76
+ const fileWithUpdatedImport = moveImport(filePath, bufferFileContent, project, migrationData);
77
+ if (fileWithUpdatedImport) {
78
+ tree.overwrite(filePath, fileWithUpdatedImport);
79
+ }
80
+ });
81
+ }
82
+ };
83
+ exports.visitor = visitor;
84
+ const moveImport = (filePath, bufferFileContent, project, migrationData) => {
85
+ var _a, _b, _c;
86
+ const fileContent = bufferFileContent.toString();
87
+ const predictImport = fileContent.includes(migrationData.change.importedValue);
88
+ if (predictImport) {
89
+ const sourceFile = (_a = project.getSourceFile(`migration-${filePath}`)) !== null && _a !== void 0 ? _a : project.createSourceFile(`migration-${filePath}`, fileContent);
90
+ const alfrescoApiImportResult = getImportedValueFromSource(sourceFile, {
91
+ importedIdentifier: migrationData.change.importedValue,
92
+ from: migrationData.change.importSource
93
+ });
94
+ if (alfrescoApiImportResult === null || alfrescoApiImportResult === void 0 ? void 0 : alfrescoApiImportResult.importedValue) {
95
+ if (alfrescoApiImportResult.allImportedValuesCount === 1) {
96
+ // There is only one import e.g. import { A } from 'A';
97
+ // Therefore, we need to remove whole import statement
98
+ (_b = alfrescoApiImportResult.importSource) === null || _b === void 0 ? void 0 : _b.remove();
99
+ }
100
+ else {
101
+ (_c = alfrescoApiImportResult.importedValue) === null || _c === void 0 ? void 0 : _c.remove();
102
+ }
103
+ const alfrescoContentServiceImport = getSourceImport(sourceFile, migrationData.to.importSource);
104
+ if (alfrescoContentServiceImport) {
105
+ alfrescoContentServiceImport.addNamedImport(migrationData.to.importedValue);
106
+ }
107
+ else {
108
+ sourceFile.insertStatements(sourceFile.getImportDeclarations().length + 1, `import { ${migrationData.to.importedValue} } from '${migrationData.to.importSource}';`);
109
+ }
110
+ return sourceFile.getFullText();
111
+ }
112
+ }
113
+ return undefined;
114
+ };
115
+ const getSourceImport = (sourceFile, from) => {
116
+ const moduleImports = sourceFile.getImportDeclarations();
117
+ const importDeclaration = moduleImports.find((moduleImport) => {
118
+ const currentImportSource = moduleImport.getModuleSpecifierValue();
119
+ return currentImportSource === from;
120
+ });
121
+ return importDeclaration;
122
+ };
123
+ const getImportedValueFromSource = (sourceFile, searchedImport) => {
124
+ var _a;
125
+ const importSource = getSourceImport(sourceFile, searchedImport.from);
126
+ if (!importSource) {
127
+ return {
128
+ importedValue: undefined,
129
+ importSource: undefined,
130
+ allImportedValuesCount: undefined
131
+ };
132
+ }
133
+ const importedValues = importSource === null || importSource === void 0 ? void 0 : importSource.getImportClause();
134
+ const namedImports = importedValues === null || importedValues === void 0 ? void 0 : importedValues.getNamedBindings();
135
+ const namedImportsElements = (_a = namedImports === null || namedImports === void 0 ? void 0 : namedImports.getElements()) !== null && _a !== void 0 ? _a : [];
136
+ const importedValue = namedImportsElements.find((binding) => binding.getName() === searchedImport.importedIdentifier);
137
+ return {
138
+ importedValue,
139
+ importSource,
140
+ allImportedValuesCount: namedImportsElements.length
141
+ };
142
+ };
143
+ exports.default = updateAlfrescoApiImports;
144
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../lib/core/schematics/migrations/7_0_0/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAsDH,4DASC;AA7DD,2DAA+F;AAC/F,uCAAiG;AAajG,MAAM,2BAA2B,GAAkB;IAC/C,MAAM,EAAE;QACJ,aAAa,EAAE,oBAAoB;QACnC,YAAY,EAAE,oBAAoB;KACrC;IACD,EAAE,EAAE;QACA,aAAa,EAAE,oBAAoB;QACnC,YAAY,EAAE,gCAAgC;KACjD;CACJ,CAAC;AAEF,MAAM,wBAAwB,GAAkB;IAC5C,MAAM,EAAE;QACJ,aAAa,EAAE,wBAA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AAC;IAED,MAAM,cAAc,GAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,eAAe,EAAE,CAAC;IACvD,MAAM,YAAY,GAAG,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,gBAAgB,EAAkB,CAAC;IACxE,MAAM,oBAAoB,GAAG,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,EAAE,mCAAI,EAAE,CAAC;IAE/D,MAAM,aAAa,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,cAAc,CAAC,kBAAkB,CAAC,CAAC;IAEtH,OAAO;QACH,aAAa;QACb,YAAY;QACZ,sBAAsB,EAAE,oBAAoB,CAAC,MAAM;KACtD,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,wBAAwB,CAAC"}
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "../../../../node_modules/@angular-devkit/schematics/collection-schema.json",
3
+ "schematics": {
4
+ "move-out-alfresco-api": {
5
+ "description": "Update alfresco-api imports",
6
+ "version": "7.0.0",
7
+ "factory": "./7_0_0/index#updateAlfrescoApiImports"
8
+ }
9
+ },
10
+ "packageJsonUpdates": {
11
+ "move-out-alfresco-api": {
12
+ "version": "7.0.0",
13
+ "packages": {
14
+ "ts-morph": {
15
+ "version": "^20.0.0",
16
+ "alwaysAddToPackageJson": true,
17
+ "addToPackageJson": "devDependencies"
18
+ },
19
+ "@alfresco/adf-content-services": {
20
+ "version": "7.0.0",
21
+ "alwaysAddToPackageJson": false
22
+ },
23
+ "@alfresco/adf-extensions": {
24
+ "version": "7.0.0",
25
+ "alwaysAddToPackageJson": false
26
+ },
27
+ "@alfresco/adf-process-services-cloud": {
28
+ "version": "7.0.0",
29
+ "alwaysAddToPackageJson": false
30
+ },
31
+ "@alfresco/adf-process-services": {
32
+ "version": "7.0.0",
33
+ "alwaysAddToPackageJson": false
34
+ },
35
+ "@alfresco/eslint-plugin-eslint-angular": {
36
+ "version": "7.0.0",
37
+ "alwaysAddToPackageJson": false
38
+ },
39
+ "@alfresco/js-api": {
40
+ "version": "8.0.0",
41
+ "alwaysAddToPackageJson": false
42
+ }
43
+ }
44
+ }
45
+ }
46
+ }