@nextcloud/files 3.9.1 → 3.9.2

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.
@@ -5,7 +5,7 @@ export declare enum DefaultType {
5
5
  DEFAULT = "default",
6
6
  HIDDEN = "hidden"
7
7
  }
8
- export interface FileActionData {
8
+ interface FileActionData {
9
9
  /** Unique ID */
10
10
  id: string;
11
11
  /** Translatable string displayed in the menu */
@@ -32,11 +32,6 @@ export interface FileActionData {
32
32
  execBatch?: (files: Node[], view: View, dir: string) => Promise<(boolean | null)[]>;
33
33
  /** This action order in the list */
34
34
  order?: number;
35
- /**
36
- * Set to true if this action is a destructive action, like "delete".
37
- * This will change the appearance in the action menu more prominent (e.g. red colored)
38
- */
39
- destructive?: boolean;
40
35
  /**
41
36
  * This action's parent id in the list.
42
37
  * If none found, will be displayed as a top-level action.
@@ -75,10 +70,10 @@ export declare class FileAction {
75
70
  get order(): number | undefined;
76
71
  get parent(): string | undefined;
77
72
  get default(): DefaultType | undefined;
78
- get destructive(): boolean | undefined;
79
73
  get inline(): ((file: Node, view: View) => boolean) | undefined;
80
74
  get renderInline(): ((file: Node, view: View) => Promise<HTMLElement | null>) | undefined;
81
75
  private validateAction;
82
76
  }
83
77
  export declare const registerFileAction: (action: FileAction) => void;
84
78
  export declare const getFileActions: () => FileAction[];
79
+ export {};
@@ -14,10 +14,6 @@ export interface IFileListFilterChip {
14
14
  * Optional icon to be used on the chip (inline SVG as string)
15
15
  */
16
16
  icon?: string;
17
- /**
18
- * Optional pass a user id to use a user avatar instead of an icon
19
- */
20
- user?: string;
21
17
  /**
22
18
  * Handler to be called on click
23
19
  */
@@ -3,10 +3,6 @@ import { INode, Node } from './node';
3
3
 
4
4
  export declare class File extends Node {
5
5
  get type(): FileType;
6
- /**
7
- * Returns a clone of the file
8
- */
9
- clone(): File;
10
6
  }
11
7
  /**
12
8
  * Interface of the File class
@@ -7,10 +7,6 @@ export declare class Folder extends Node {
7
7
  get type(): FileType;
8
8
  get extension(): string | null;
9
9
  get mime(): string;
10
- /**
11
- * Returns a clone of the folder
12
- */
13
- clone(): Node;
14
10
  }
15
11
  /**
16
12
  * Interface of the folder class
@@ -134,10 +134,6 @@ export declare abstract class Node {
134
134
  * Set the node status.
135
135
  */
136
136
  set status(status: NodeStatus | undefined);
137
- /**
138
- * Get the node data
139
- */
140
- get data(): NodeData;
141
137
  /**
142
138
  * Move the node to a new destination
143
139
  *
@@ -163,10 +159,6 @@ export declare abstract class Node {
163
159
  * @param attributes The new attributes to update on the Node attributes
164
160
  */
165
161
  update(attributes: Attribute): void;
166
- /**
167
- * Returns a clone of the node
168
- */
169
- abstract clone(): Node;
170
162
  }
171
163
  /**
172
164
  * Interface of the node class
package/dist/index.cjs CHANGED
@@ -119,9 +119,6 @@ class FileAction {
119
119
  get default() {
120
120
  return this._action.default;
121
121
  }
122
- get destructive() {
123
- return this._action.destructive;
124
- }
125
122
  get inline() {
126
123
  return this._action.inline;
127
124
  }
@@ -153,9 +150,6 @@ class FileAction {
153
150
  if ("order" in action && typeof action.order !== "number") {
154
151
  throw new Error("Invalid order");
155
152
  }
156
- if (action.destructive !== void 0 && typeof action.destructive !== "boolean") {
157
- throw new Error("Invalid destructive flag");
158
- }
159
153
  if ("parent" in action && typeof action.parent !== "string") {
160
154
  throw new Error("Invalid parent");
161
155
  }
@@ -720,12 +714,6 @@ class Node {
720
714
  set status(status) {
721
715
  this._data.status = status;
722
716
  }
723
- /**
724
- * Get the node data
725
- */
726
- get data() {
727
- return structuredClone(this._data);
728
- }
729
717
  /**
730
718
  * Move the node to a new destination
731
719
  *
@@ -788,12 +776,6 @@ class File extends Node {
788
776
  get type() {
789
777
  return FileType.File;
790
778
  }
791
- /**
792
- * Returns a clone of the file
793
- */
794
- clone() {
795
- return new File(this.data);
796
- }
797
779
  }
798
780
  class Folder extends Node {
799
781
  constructor(data) {
@@ -811,12 +793,6 @@ class Folder extends Node {
811
793
  get mime() {
812
794
  return "httpd/unix-directory";
813
795
  }
814
- /**
815
- * Returns a clone of the folder
816
- */
817
- clone() {
818
- return new Folder(this.data);
819
- }
820
796
  }
821
797
  function davGetRootPath() {
822
798
  if (_public.isPublicShare()) {
@@ -1098,7 +1074,7 @@ function sortNodes(nodes, options = {}) {
1098
1074
  // 3: Use sorting mode if NOT basename (to be able to use display name too)
1099
1075
  ...sortingOptions.sortingMode !== "basename" ? [(v) => v[sortingOptions.sortingMode]] : [],
1100
1076
  // 4: Use display name if available, fallback to name
1101
- (v) => basename(v.displayname || v.attributes?.displayname || v.basename),
1077
+ (v) => basename(v.attributes?.displayname || v.basename),
1102
1078
  // 5: Finally, use basename if all previous sorting methods failed
1103
1079
  (v) => v.basename
1104
1080
  ];