@pooder/core 1.0.0 → 1.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @pooder/core
2
2
 
3
+ ## 1.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ruler and size
8
+
9
+ ## 1.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - bugfix
14
+
3
15
  ## 1.0.0
4
16
 
5
17
  ### Major Changes
package/dist/index.d.mts CHANGED
@@ -61,7 +61,7 @@ interface ViewContribution {
61
61
  */
62
62
  interface ConfigurationContribution {
63
63
  id: string;
64
- type: "string" | "number" | "boolean" | "color" | "select" | "json";
64
+ type: "string" | "number" | "boolean" | "color" | "select" | "json" | "array";
65
65
  label: string;
66
66
  default?: any;
67
67
  description?: string;
@@ -256,8 +256,8 @@ declare class Pooder {
256
256
  readonly extensionManager: ExtensionManager;
257
257
  constructor();
258
258
  private initDefaultContributionPoints;
259
- registerService(service: Service): boolean;
260
- unregisterService(service: Service): boolean;
259
+ registerService(service: Service, id?: string): boolean;
260
+ unregisterService(service: Service, id?: string): boolean;
261
261
  getService<T extends Service>(id: string): T | undefined;
262
262
  registerContributionPoint<T>(point: ContributionPoint<T>): void;
263
263
  registerContribution<T>(pointId: string, contribution: Contribution<T>): Disposable;
package/dist/index.d.ts CHANGED
@@ -61,7 +61,7 @@ interface ViewContribution {
61
61
  */
62
62
  interface ConfigurationContribution {
63
63
  id: string;
64
- type: "string" | "number" | "boolean" | "color" | "select" | "json";
64
+ type: "string" | "number" | "boolean" | "color" | "select" | "json" | "array";
65
65
  label: string;
66
66
  default?: any;
67
67
  description?: string;
@@ -256,8 +256,8 @@ declare class Pooder {
256
256
  readonly extensionManager: ExtensionManager;
257
257
  constructor();
258
258
  private initDefaultContributionPoints;
259
- registerService(service: Service): boolean;
260
- unregisterService(service: Service): boolean;
259
+ registerService(service: Service, id?: string): boolean;
260
+ unregisterService(service: Service, id?: string): boolean;
261
261
  getService<T extends Service>(id: string): T | undefined;
262
262
  registerContributionPoint<T>(point: ContributionPoint<T>): void;
263
263
  registerContribution<T>(pointId: string, contribution: Contribution<T>): Disposable;
package/dist/index.js CHANGED
@@ -488,9 +488,9 @@ var Pooder = class {
488
488
  this.contributions = new ContributionRegistry();
489
489
  this.initDefaultContributionPoints();
490
490
  const commandService = new CommandService();
491
- this.registerService(commandService);
491
+ this.registerService(commandService, "CommandService");
492
492
  const configurationService = new ConfigurationService();
493
- this.registerService(configurationService);
493
+ this.registerService(configurationService, "ConfigurationService");
494
494
  const context = {
495
495
  eventBus: this.eventBus,
496
496
  services: {
@@ -526,9 +526,9 @@ var Pooder = class {
526
526
  });
527
527
  }
528
528
  // --- Service Management ---
529
- registerService(service) {
529
+ registerService(service, id) {
530
530
  var _a;
531
- const serviceId = service.constructor.name;
531
+ const serviceId = id || service.constructor.name;
532
532
  try {
533
533
  (_a = service == null ? void 0 : service.init) == null ? void 0 : _a.call(service);
534
534
  } catch (e) {
@@ -539,9 +539,9 @@ var Pooder = class {
539
539
  this.eventBus.emit("service:register", service);
540
540
  return true;
541
541
  }
542
- unregisterService(service) {
542
+ unregisterService(service, id) {
543
543
  var _a;
544
- const serviceId = service.constructor.name;
544
+ const serviceId = id || service.constructor.name;
545
545
  if (!this.services.has(serviceId)) {
546
546
  console.warn(`Service ${serviceId} is not registered.`);
547
547
  return true;
package/dist/index.mjs CHANGED
@@ -455,9 +455,9 @@ var Pooder = class {
455
455
  this.contributions = new ContributionRegistry();
456
456
  this.initDefaultContributionPoints();
457
457
  const commandService = new CommandService();
458
- this.registerService(commandService);
458
+ this.registerService(commandService, "CommandService");
459
459
  const configurationService = new ConfigurationService();
460
- this.registerService(configurationService);
460
+ this.registerService(configurationService, "ConfigurationService");
461
461
  const context = {
462
462
  eventBus: this.eventBus,
463
463
  services: {
@@ -493,9 +493,9 @@ var Pooder = class {
493
493
  });
494
494
  }
495
495
  // --- Service Management ---
496
- registerService(service) {
496
+ registerService(service, id) {
497
497
  var _a;
498
- const serviceId = service.constructor.name;
498
+ const serviceId = id || service.constructor.name;
499
499
  try {
500
500
  (_a = service == null ? void 0 : service.init) == null ? void 0 : _a.call(service);
501
501
  } catch (e) {
@@ -506,9 +506,9 @@ var Pooder = class {
506
506
  this.eventBus.emit("service:register", service);
507
507
  return true;
508
508
  }
509
- unregisterService(service) {
509
+ unregisterService(service, id) {
510
510
  var _a;
511
- const serviceId = service.constructor.name;
511
+ const serviceId = id || service.constructor.name;
512
512
  if (!this.services.has(serviceId)) {
513
513
  console.warn(`Service ${serviceId} is not registered.`);
514
514
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pooder/core",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "Core logic for Pooder editor",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -43,7 +43,14 @@ export interface ViewContribution {
43
43
  */
44
44
  export interface ConfigurationContribution {
45
45
  id: string;
46
- type: "string" | "number" | "boolean" | "color" | "select" | "json";
46
+ type:
47
+ | "string"
48
+ | "number"
49
+ | "boolean"
50
+ | "color"
51
+ | "select"
52
+ | "json"
53
+ | "array";
47
54
  label: string;
48
55
  default?: any;
49
56
  description?: string;
package/src/index.ts CHANGED
@@ -29,10 +29,10 @@ export class Pooder {
29
29
  this.initDefaultContributionPoints();
30
30
 
31
31
  const commandService = new CommandService();
32
- this.registerService(commandService);
32
+ this.registerService(commandService, "CommandService");
33
33
 
34
34
  const configurationService = new ConfigurationService();
35
- this.registerService(configurationService);
35
+ this.registerService(configurationService, "ConfigurationService");
36
36
 
37
37
  // Create a restricted context for extensions
38
38
  const context: ExtensionContext = {
@@ -80,8 +80,8 @@ export class Pooder {
80
80
 
81
81
  // --- Service Management ---
82
82
 
83
- registerService(service: Service) {
84
- const serviceId = service.constructor.name;
83
+ registerService(service: Service, id?: string) {
84
+ const serviceId = id || service.constructor.name;
85
85
 
86
86
  try {
87
87
  service?.init?.();
@@ -95,8 +95,8 @@ export class Pooder {
95
95
  return true;
96
96
  }
97
97
 
98
- unregisterService(service: Service) {
99
- const serviceId = service.constructor.name;
98
+ unregisterService(service: Service, id?: string) {
99
+ const serviceId = id || service.constructor.name;
100
100
  if (!this.services.has(serviceId)) {
101
101
  console.warn(`Service ${serviceId} is not registered.`);
102
102
  return true;