@ibm-wch-sdk/ng-edit

Module to attach inline-edit functionality to an WCH based Angular application.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@ibm-wch-sdk/ng-edit
6.0.5245 years ago6 years agoMinified + gzip package size for @ibm-wch-sdk/ng-edit in KB

Readme

ibm-wch-sdk-ng-edit
Module to attach inline-edit functionality to an WCH based Angular application. The library exposes the WchNgEditModule module.

Changes

CHANGELOG

Details

Refer to the documentation.

Class documentation

Refer to the documentation.

Usage

Install the module via
npm install --save @ibm-wch-sdk/ng-edit

Add the module to your root application
@NgModule({
  ...
  imports: [
    ...
    WchNgEditModule.forRoot(environment)
  ],
  ...
})
export class AppModule { }

The module exposes the WchEditService and the wchEditable directive.

Prereqs

Directive wchEditable

The directive attaches inline edit functionality to an element that is managed by WCH. The implementation in this library only dispatches the actual realization of the inline-edit functionality to a pluggable service provider.
The directive assumes that the Component contains a onRenderingContext property that exposes the RenderingContext of the item currently edited. This contract is fulfilled automatically if the component extends AbstractRenderingComponent.
The directive requires as a parameter a string identifying the editable property. This string must reference a property on the Component that has been bound to a field of the content item via a @RenderingContextBinding directive. This directive contains the actual selector of the field. Note that this binding is done automatically if the components are generated via the CLI.

Example

<div wchEditable="myField">{{renderingContext.elements.myField.value}}</div>

assuming the following binding
export class MyComponent extends AbstractRenderingComponent {
  @RenderingContextBinding('elements.myField.value') myField: string;
}

WchNgEditModule

The module exposes the directives and services. Per default it provides a service that loads the inline edit functionality from the site composer, when registering the module using the forRoot method.
  • forRoot(config?): the method registers the module and provides a service to load inline edit from the site composer. The location to load the edit script from is configurable via the config script, typically used for local debugging of the script via the inlineEditUrl member on the config object. A convenient way to inject this is to add inlineEditUrl to your environment object and then inject the environment object.

Example

import { WchNgEditModule } from '@ibm-wch-sdk/ng-edit';


@NgModule({
  ...
  imports: [
    ...
    WchNgEditModule.forRoot(environment),
    ...
  ]
})
export class AppModule {
}

WchEditInfoService

The service allows to find out if an inline edit operation is taking place. Applications might want to stop any background processing during this period to avoid intercepting with the edit operation.
  • onEditing: Observable<boolean>: the observable that tracks the state of the current inline edit operation. It is a shared observable that dispatches the current state and all subsequent states.

WchInlineEditService

Service providers implement the WchInlineEditService and provide to the module. This service realizes the actual implementation of the inline edit operation.
  • registerComponent(el, accessor, onRenderingContext): Observable<EventTargetLike>: this method will be invoked by the [wchEditable] directive for every editable element in the application. The el parameter references the editable DOM element. The accessor is string that represents the Javascript property accessor into the content items for the editable element. onRenderingContext exposes the context of the currently edited item. The method returns an observable of an event emitter. Subscribing to this observable makes the registration active, unsubscribing cancels it. The event emitter is used to listen for edit events.

Edit events

The following inline edit events are recognized:
  • wchEditStart: fired when an element enters into inline edit mode. This is used to track this status by the WchEditInfoService.
  • wchEditEnd: fired when an element leaves inline edit mode (no matter whether the edit operation has been canceled or completed). This is used to track this status by the WchEditInfoService.

WchHttpInlineEditService

The default implementation of the WchInlineEditService. If the system is in preview mode, then the service lazily loads an inline edit script from a configurable location. Per default this location points to TODO, it can be overridden by the inlineEditUrl property on the config object for the module.

Script requirements

The inline edit script will be loaded via an HTTP request and executed dynamically. It needs to contain an IIFE that returns a registration object with the following properties:
  • register(el, accessor, onRenderingContext): Handle: the register method will be called for every editable element, so the implementation of the method can attach the necessary event handlers to the DOM element to make it editable. The method returns a handle that allows to cancel the registration and to attach event handlers to the inline edit process to monitor it. The method receives the DOM element via the el parameter and an accessor that represents a Javascript property expression for the editable element in the content item. The onRenderingContext observable exposes the current context of the rendered item.

Handle

The handle needs to conform to one of the signatures of EventTargetLike from the RXJS spec. In addition it can expose a dispose method.
  • dispose: the dispose method on the handle will be invoked to cancel a registration. This happens when the editable element falls out of scope, e.g. because of a page switch or because the application decides to hide it or for any other reason. Implementers need to make sure to unregister all previously registered event handlers.

Require

The inline edit script can use a require function that is available in its scope to load extra resources or services exposed by the SDK. The following services are available:
  • wch-config: a configuration object containing URLs for the current tenant
  • wch-info: the hub configuration exposed to the SDK by the SPA
  • wch-logger: access to the SDK logging infrastructure. It is suggested to uses the exposed logger instead of console logs.

In addition the require function will resolve URLs relative to the URL used to load the script and returns the result as text. All return values are exposed as promises.
Example for accessing the config:
const config = require('wch-config');
config.then(c => console.log(c.apiUrl));

Example for loading an extra resource:
const res = require('./myExtraResource.txt');
res.then(console.log);

Example for using the logger:
const logger = require('wch-logger');
logger
  .then(logger => logger.get('MyModule'))
  .then(log => log.info('some log output'));

Accessor Expression

Accessor expressions allow to identify the field of a Content Item that the inline edit operation refers to. It is a string in the format of a Javascript property accessor.

Examples

  • name: accesses the name attribute of a content item.
  • elements.myText.value: accesses the value of a single valued element called myText.
  • elements.myTexts.values[2]: accesses the third value of a multi valued element called myTexts.

Changelog

Current

6.0.69

Changed

  • Improved readme

Added

  • Support for Angular 6
  • Support for group elements
  • Initial version

WchNgEditModule
Module that allows to attach inline edit functionality to a WCH based Angular application.

Usage

Install the module
npm install --save ibm-wch-sdk-ng-edit

Import the module into your application. Use the environment variable to configure the module, this is the same configuration as for the main WchNgModule module.
import {WchNgEditModule} from 'ibm-wch-sdk-ng-edit';

...

@NgModule({
  ...
  imports: [
    WchNgEditModule.forRoot(environment)
    ...
  ]

Annotate your editable components. Pass the selector to the text field as parameter to the directive.
<div wchEditable='elements.myText'>{{renderingContext.elements.myText.value}}</div>

Dependencies

The modules assumes an implementation of the WchInlineEditService. This service must be injected into the main module.

Developing modules based on the SDK

When developing modules that use the SDK, make sure to import the WchNgEditComponentsModule to have access to the components and directives exposed by the SDK.

Configuration

The module can be configured via the forRoot method or by providing overrides for the individual configuration tokens.

Components

The module exposes the following Components.
@ibm-wch-sdk/ng-edit

Index

External modules



@ibm-wch-sdk/ng-edit > "components/login/abstract.login.component"
External module: "components/login/abstract.login.component"

Index

Classes

Variables


Variables

<Const> LOGGER

● LOGGER: "AbstractLoginComponent" = "AbstractLoginComponent"
Defined in components/login/abstract.login.component.ts:17

@ibm-wch-sdk/ng-edit
> "components/placeholder/placeholder.component"
External module: "components/placeholder/placeholder.component"

Index

Classes

Variables


Variables

<Let> COUNT

● COUNT: number = 0
Defined in components/placeholder/placeholder.component.ts:49

<Const> LOGGER

● LOGGER: "WchPlaceholderComponent" = "WchPlaceholderComponent"
Defined in components/placeholder/placeholder.component.ts:46

@ibm-wch-sdk/ng-edit
> "config/config"
External module: "config/config"

Index

Variables


Variables

<Const> WCHEDITHUBINFOSERVICE

● WCHEDITHUBINFOSERVICE: InjectionToken<EditHubInfoService> = new InjectionToken( 'EditHubInfoService' )
Defined in config/config.ts:46

<Const> WCHTHROTTLELOADING

● WCHTHROTTLELOADING: "D1576F60-7D2A-4824-9771-A1EB574771DB" = "D1576F60-7D2A-4824-9771-A1EB574771DB"
Defined in config/config.ts:44
Injection token for placeholder debugging
see: EditHubInfoService

<Const> WCHTOKENDEBUGPLACEHOLDERS

● WCHTOKENDEBUGPLACEHOLDERS: "03066F08-3E5E-41BE-B1E9-B0F31D0C881D" = "03066F08-3E5E-41BE-B1E9-B0F31D0C881D"
Defined in config/config.ts:36
Injection token for placeholder debugging
see: EditHubInfoService

<Const> WCHTOKENDEFAULTPLACEHOLDERTEXT

● WCHTOKENDEFAULTPLACEHOLDERTEXT: "10DDECF4-3818-4B08-BD34-CA073F831E9B" = "10DDECF4-3818-4B08-BD34-CA073F831E9B"
Defined in config/config.ts:14
Injection token for default placeholder text
see: EditHubInfoService
import { InjectionToken } from '@angular/core';
import { EditHubInfoService } from './../services/config/wch.edit.config';

<Const> WCHTOKENINLINEEDITURL

● WCHTOKENINLINEEDITURL: "0E7D0A87-FBDD-4565-9C8F-DB5909B6D9AF" = "0E7D0A87-FBDD-4565-9C8F-DB5909B6D9AF"
Defined in config/config.ts:22
Injection token for inline edit url
see: EditHubInfoService

<Const> WCHTOKENPLACEHOLDERTAG

● WCHTOKENPLACEHOLDERTAG: "C80F7BDA-438D-49F9-B63B-3BDA1FC13E99" = "C80F7BDA-438D-49F9-B63B-3BDA1FC13E99"
Defined in config/config.ts:29
Injection token for placeholder tag
see: EditHubInfoService


@ibm-wch-sdk/ng-edit
> "config/index"
External module: "config/index"

Index

---
@ibm-wch-sdk/ng-edit > "directives/editable/abstract.editable.directive"
External module: "directives/editable/abstract.editable.directive"

Index

Classes

Type aliases

Variables


Type aliases

WchEditableType

Ƭ WchEditableType: string \| null
Defined in directives/editable/abstract.editable.directive.ts:80

Variables

<Const> COMPONENTACCESSOR

● COMPONENTACCESSOR: AccessorType = null
Defined in directives/editable/abstract.editable.directive.ts:83

<Let> COUNT

● COUNT: number = 0
Defined in directives/editable/abstract.editable.directive.ts:73

<Const> KEYONRENDERINGCONTEXT

● KEYONRENDERINGCONTEXT: "onRenderingContext" = "onRenderingContext"
Defined in directives/editable/abstract.editable.directive.ts:75

<Const> LOGGER

● LOGGER: "AbstractWchEditableDirective" = "AbstractWchEditableDirective"
Defined in directives/editable/abstract.editable.directive.ts:77

<Const> ONCOMPONENTACCESSOR

● ONCOMPONENTACCESSOR: Observable<string> = of(COMPONENT
ACCESSOR)
Defined in directives/editable/abstract.editable.directive.ts:86

@ibm-wch-sdk/ng-edit
> "directives/editable/editable.directive"
External module: "directives/editable/editable.directive"

Index

Classes



@ibm-wch-sdk/ng-edit > "directives/editable/editable.placeholder.directive"
External module: "directives/editable/editable.placeholder.directive"

Index

Classes

Type aliases

Variables

Functions


Type aliases

TEXTPROPERTY

Ƭ TEXTPROPERTY: "innerHTML" \| "innerText"
Defined in directives/editable/editable.placeholder.directive.ts:72

Variables

<Const> LOGGER

● LOGGER: "WchEditablePlaceholderDirective" = "WchEditablePlaceholderDirective"
Defined in directives/editable/editable.placeholder.directive.ts:70

Functions

setText

setText(aProp: TEXTPROPERTY
, aLocalizedText: LocalizedText, aElement: ElementRef, aRenderer: Renderer2): void
Defined in directives/editable/editable.placeholder.directive.ts:82
Assigns the text to a value
Parameters:
| Name | Type | Description | | ------ | ------ | ------ | | aProp | TEXTPROPERTY
| the property to assign | | aLocalizedText | LocalizedText | the actual text | | aElement | ElementRef | the native element | | aRenderer | Renderer2 | render used to assign the text |
Returns: void

<Const> textSetter

textSetter(aElement: any, aRenderer: Renderer2): (Anonymous function)
Defined in directives/editable/editable.placeholder.directive.ts:113
Binds the element ref and the renderer
Parameters:
| Name | Type | Description | | ------ | ------ | ------ | | aElement | any | the eleemnt reference | | aRenderer | Renderer2 | the renderer |
Returns: (Anonymous function) function that only takes the property name and the

@ibm-wch-sdk/ng-edit
> "index"
External module: "index"

Index

---
@ibm-wch-sdk/ng-edit > "interfaces/inline.edit.service"
External module: "interfaces/inline.edit.service"

Index

Variables


Variables

<Const> EVENTEDITEND

● EVENTEDITEND: "wchEditEnd" = "wchEditEnd"
Defined in interfaces/inline.edit.service.ts:7

<Const> EVENTEDITSTART

● EVENTEDITSTART: "wchEditStart" = "wchEditStart"
Defined in interfaces/inline.edit.service.ts:6

<Const> EVENTINLINEEDITEND

● EVENTINLINEEDITEND: "wchInlineEditEnd" = "wchInlineEditEnd"
Defined in interfaces/inline.edit.service.ts:10

<Const> EVENTINLINEEDITSTART

● EVENTINLINEEDITSTART: "wchInlineEditStart" = "wchInlineEditStart"
Defined in interfaces/inline.edit.service.ts:9

<Const> WchInlineEditServiceToken

● WchInlineEditServiceToken: InjectionToken<WchInlineEditService> = new InjectionToken< WchInlineEditService >('WchInlineEditServiceToken')
Defined in interfaces/inline.edit.service.ts:15

@ibm-wch-sdk/ng-edit
> "module"
External module: "module"

Index

Classes

Variables


Variables

<Const> WCHRCINTERCEPTORTOKEN

● WCHRCINTERCEPTORTOKEN: "8453750A-4519-4184-840B-D490E909D23E" = "8453750A-4519-4184-840B-D490E909D23E"
Defined in module.ts:32

@ibm-wch-sdk/ng-edit
> "modules/components.module"
External module: "modules/components.module"

Index

Classes



@ibm-wch-sdk/ng-edit > "modules/services.module"
External module: "modules/services.module"

Index

Classes



@ibm-wch-sdk/ng-edit > "placeholder/placeholder"
External module: "placeholder/placeholder"

Index

Variables

Functions


Variables

<Const> RELPATHTYPEBYID

● RELPATHTYPEBYID: "delivery/v1/rendering/type/" = "delivery/v1/rendering/type/"
Defined in placeholder/placeholder.ts:8

Functions

loadAuthoringType

loadAuthoringType(aService: WchHttpService, aTypeId: string): Observable<AuthoringType>
Defined in placeholder/placeholder.ts:10
Parameters:
| Name | Type | | ------ | ------ | | aService | WchHttpService | | aTypeId | string |
Returns: Observable<AuthoringType>

@ibm-wch-sdk/ng-edit
> "services/config/default.wch.edit.config"
External module: "services/config/default.wch.edit.config"

Index

Variables


Variables

<Const> DEFAULTDEBUGPLACEHOLDERS

● DEFAULTDEBUGPLACEHOLDERS: false = false
Defined in services/config/default.wch.edit.config.ts:8

<Const> DEFAULTINLINEEDITURL

● DEFAULTINLINEEDITURL: "${authoringUIBaseUrl.protocol}//${authoringUIBaseUrl.host}/authoring-sites-ui/inline-edit/inline-edit.js" = "${authoringUIBaseUrl.protocol}//${authoringUIBaseUrl.host}/authoring-sites-ui/inline-edit/inline-edit.js"
Defined in services/config/default.wch.edit.config.ts:4

@ibm-wch-sdk/ng-edit
> "services/config/index"
External module: "services/config/index"

Index

---
@ibm-wch-sdk/ng-edit > "services/config/wch.edit.config"
External module: "services/config/wch.edit.config"

Index

Interfaces

Functions


Functions

selectDebugPlaceholder

selectDebugPlaceholder(aConfig?: EditHubInfoService): boolean
Defined in services/config/wch.edit.config.ts:47
Parameters:
| Name | Type | | ------ | ------ | | Optional aConfig | EditHubInfoService
|
Returns: boolean

selectDefaultPlaceholder

selectDefaultPlaceholder(aConfig?: EditHubInfoService
): WchDefaultPlaceholder
Defined in services/config/wch.edit.config.ts:41
Parameters:
| Name | Type | | ------ | ------ | | Optional aConfig | EditHubInfoService |
Returns: WchDefaultPlaceholder

selectInlineEditURL

selectInlineEditURL(aConfig?: EditHubInfoService
): HubInfoUrlProvider
Defined in services/config/wch.edit.config.ts:51
Parameters:
| Name | Type | | ------ | ------ | | Optional aConfig | EditHubInfoService
|
Returns: HubInfoUrlProvider

selectPlaceholderTag

selectPlaceholderTag(aConfig?: EditHubInfoService
): string
Defined in services/config/wch.edit.config.ts:57
Parameters:
| Name | Type | | ------ | ------ | | Optional aConfig | EditHubInfoService
|
Returns: string

selectThrottleLoading

selectThrottleLoading(aConfig?: EditHubInfoService
): number
Defined in services/config/wch.edit.config.ts:61
Parameters:
| Name | Type | | ------ | ------ | | Optional aConfig | EditHubInfoService
|
Returns: number

@ibm-wch-sdk/ng-edit
> "services/edit/wch.inline.edit.service"
External module: "services/edit/wch.inline.edit.service"

Index

Classes

Variables


Variables

<Const> LOGGER

● LOGGER: "WchInlineEditRegistrationService" = "WchInlineEditRegistrationService"
Defined in services/edit/wch.inline.edit.service.ts:25

@ibm-wch-sdk/ng-edit
> "services/http/http.inline.edit.service"
External module: "services/http/http.inline.edit.service"

Index

Classes

Interfaces

Variables

Functions

Object literals


Variables

<Const> EMPTYREGISTRATION

● EMPTYREGISTRATION: NodeStyleEventEmitter \| JQueryStyleEventEmitter \| HasEventTargetAddRemove<any> \| NodeStyleEventEmitter & Disposable \| JQueryStyleEventEmitter & Disposable \| HasEventTargetAddRemove<any> & Disposable = createEmptyRegistration()
Defined in services/http/http.inline.edit.service.ts:138

<Const> LOGGER

● LOGGER: "WchHttpInlineEditService" = "WchHttpInlineEditService"
Defined in services/http/http.inline.edit.service.ts:73

<Let> REGID

● REGID: number = 0
Defined in services/http/http.inline.edit.service.ts:141

<Const> dummyFromEvent

dummyFromEvent: function = constGenerator(EMPTY)
Defined in services/http/http.inline.edit.service.ts:228
Dummy callback
param:

Type declaration

▸<T>(): Observable<T>
Type parameters:

T

Returns: Observable<T>

<Const> fromHubInfoUrlProvider

fromHubInfoUrlProvider: UnaryFunction<string \| URL, string> = compose< URL | string, GeneratorOrT, string >( urlToString, fromGeneratorOrT )
Defined in services/http/http.inline.edit.service.ts:251
Converts the provider into a URL
param: the provider
returns: the URL if available

<Const> registerDummyComponent

registerDummyComponent: function = constGenerator(of(EMPTYREGISTRATION))
Defined in services/http/http.inline.edit.service.ts:237
Registers a dummy component
param: the native element
param: the accesor
param: rendering context

Type declaration

▸(): T
Returns: T

Functions

createEmptyRegistration

createEmptyRegistration(): WchInlineEditRegistrationResult
Defined in services/http/http.inline.edit.service.ts:85
Creates an empty registration result as fallback
Returns: WchInlineEditRegistrationResult

createRegistration

createRegistration(aRegisterMethod: WchInlineEditRegistration, nativeElement: any, accessor: AccessorType, onRenderingContext: Observable<RenderingContext>, logger: Logger): Observable<EventTargetLike<any>>
Defined in services/http/http.inline.edit.service.ts:153
Constructs the registration for a native element
Parameters:
| Name | Type | Description | | ------ | ------ | ------ | | aRegisterMethod | WchInlineEditRegistration | registration callback method | | nativeElement | any | the native element | | accessor | AccessorType | accessor string | | onRenderingContext | Observable<RenderingContext> | rendering context | | logger | Logger |
Returns: Observable<EventTargetLike<any>> observable of the registration result in form of an event emitter

createWchInlineEditEvent

createWchInlineEditEvent(aType: string, aData: any): WchInlineEditEvent
Defined in services/http/http.inline.edit.service.ts:102
Constructs the event
Parameters:
| Name | Type | Description | | ------ | ------ | ------ | | aType | string | the event type | | aData | any | the event data |
Returns: WchInlineEditEvent the event object

getAbsoluteUrl

getAbsoluteUrl(base: string, relative: string): string
Defined in services/http/http.inline.edit.service.ts:199
Resolves a relative URL against a base URL
Parameters:
| Name | Type | Description | | ------ | ------ | ------ | | base | string | the base URL | | relative | string | the relative URL |
Returns: string the result

registerForEvent

registerForEvent(aType: string, aEmitter: EventTargetLike<any>, aLogger: Logger): Observable<WchInlineEditEvent>
Defined in services/http/http.inline.edit.service.ts:121
Registers for an event
Parameters:
| Name | Type | Description | | ------ | ------ | ------ | | aType | string | the event type | | aEmitter | EventTargetLike<any> | the event emitter | | aLogger | Logger |
Returns: Observable<WchInlineEditEvent> the sequence of events

Object literals

<Const> EMPTYWCHINLINEEDITSERVICE

EMPTYWCHINLINEEDITSERVICE: object
Defined in services/http/http.inline.edit.service.ts:240

fromEvent

● fromEvent: function =
dummyFromEvent
Defined in services/http/http.inline.edit.service.ts:242

Type declaration

▸<T>(): Observable<T>
Type parameters:

T

Returns: Observable<T>

registerComponent

● registerComponent: function =
registerDummyComponent
Defined in services/http/http.inline.edit.service.ts:241

Type declaration

▸(): T
Returns: T


@ibm-wch-sdk/ng-edit
> "services/http/index"
External module: "services/http/index"

Index

---
@ibm-wch-sdk/ng-edit > "services/index"
External module: "services/index"

Index

---
@ibm-wch-sdk/ng-edit > "services/info/index"
External module: "services/info/index"

Index

---
@ibm-wch-sdk/ng-edit > "services/info/wch.edit.info.service"
External module: "services/info/wch.edit.info.service"

Index

Classes

Variables


Variables

<Const> LOGGER

● LOGGER: "WchEditInfoService" = "WchEditInfoService"
Defined in services/info/wch.edit.info.service.ts:10

@ibm-wch-sdk/ng-edit
> "services/info/wch.internal.edit.service"
External module: "services/info/wch.internal.edit.service"

Index

Classes

Variables


Variables

<Const> DEFAULTEDITING

● DEFAULTEDITING: false = false
Defined in services/info/wch.internal.edit.service.ts:9

<Const> DEFAULTINLINEEDIT

● DEFAULTINLINEEDIT: false = false
Defined in services/info/wch.internal.edit.service.ts:10

@ibm-wch-sdk/ng-edit
> "services/placeholders/placeholders.service"
External module: "services/placeholders/placeholders.service"

Index

Classes

Interfaces

Variables


Variables

<Const> LOGGER

● LOGGER: "WchPlaceholderImpl" = "WchPlaceholderImpl"
Defined in services/placeholders/placeholders.service.ts:94

<Const> selectFromWchPlaceholder

selectFromWchPlaceholder: function = pluckProperty
Defined in services/placeholders/placeholders.service.ts:339
some type magic

Type declaration

▸<K>(aKey: K): UnaryFunction<WchPlaceholder
, WchPlaceholder[K]>
Type parameters:

K : keyof WchPlaceholder

Parameters:
| Name | Type | | ------ | ------ | | aKey | K |
Returns: UnaryFunction<WchPlaceholder, WchPlaceholder[K]>

<Const> opOnAccessor

● opOnAccessor: OperatorFunction<WchPlaceholder
, string> = switchMap( selectOnAccessor )
Defined in services/placeholders/placeholders.service.ts:357

<Const> opOnData

● opOnData: OperatorFunction<WchPlaceholder
, any> = switchMap( selectOnData )
Defined in services/placeholders/placeholders.service.ts:364

<Const> opOnFormattedText

● opOnFormattedText: OperatorFunction<WchPlaceholder
, LocalizedText> = switchMap(selectOnFormattedText)
Defined in services/placeholders/placeholders.service.ts:371

<Const> opOnPlaceholder

● opOnPlaceholder: OperatorFunction<WchPlaceholder
, AuthoringPlaceholder> = switchMap(selectOnPlaceholder)
Defined in services/placeholders/placeholders.service.ts:360

<Const> opOnPlainText

● opOnPlainText: OperatorFunction<WchPlaceholder
, LocalizedText> = switchMap(selectOnPlainText)
Defined in services/placeholders/placeholders.service.ts:367

<Const> opOnType

● opOnType: OperatorFunction<WchPlaceholder
, string> = switchMap( selectOnType )
Defined in services/placeholders/placeholders.service.ts:375

<Const> selectOnAccessor

● selectOnAccessor: UnaryFunction<WchPlaceholder
, Observable<string>> = selectFromWchPlaceholder('onAccessor')
Defined in services/placeholders/placeholders.service.ts:347

<Const> selectOnData

● selectOnData: UnaryFunction<WchPlaceholder
, Observable<any>> = selectFromWchPlaceholder('onData')
Defined in services/placeholders/placeholders.service.ts:349

<Const> selectOnFormattedText

● selectOnFormattedText: UnaryFunction<WchPlaceholder
, Observable<Object>> = selectFromWchPlaceholder( 'onFormattedText' )
Defined in services/placeholders/placeholders.service.ts:351

<Const> selectOnPlaceholder

● selectOnPlaceholder: UnaryFunction<WchPlaceholder
, Observable<AuthoringPlaceholder>> = selectFromWchPlaceholder('onPlaceholder')
Defined in services/placeholders/placeholders.service.ts:348

<Const> selectOnPlainText

● selectOnPlainText: UnaryFunction<WchPlaceholder
, Observable<Object>> = selectFromWchPlaceholder('onPlainText')
Defined in services/placeholders/placeholders.service.ts:350

<Const> selectOnType

● selectOnType: UnaryFunction<WchPlaceholder
, Observable<string>> = selectFromWchPlaceholder('onType')
Defined in services/placeholders/placeholders.service.ts:354

@ibm-wch-sdk/ng-edit
> "services/rendering/index"
External module: "services/rendering/index"

Index

---
@ibm-wch-sdk/ng-edit > "services/rendering/placeholder.interceptor"
External module: "services/rendering/placeholder.interceptor"

Index

Classes

Variables


Variables

<Const> LOGGER

● LOGGER: "PlaceholderInterceptor" = "PlaceholderInterceptor"
Defined in services/rendering/placeholder.interceptor.ts:38

@ibm-wch-sdk/ng-edit
> "services/wch/index"
External module: "services/wch/index"

Index

---
@ibm-wch-sdk/ng-edit > "services/wch/wch.edit.service"
External module: "services/wch/wch.edit.service"

Index

Classes

Variables

Functions

Object literals


Variables

<Const> FALSEOBSERVABLE

● FALSEOBSERVABLE: Observable<boolean> = opFalse
Defined in services/wch/wch.edit.service.ts:74

<Const> LOGGER

● LOGGER: "WchEditService" = "WchEditService"
Defined in services/wch/wch.edit.service.ts:72

Functions

<Const> TOANONYMOUS

TOANONYMOUS(): Observable<User>
Defined in services/wch/wch.edit.service.ts:76
Returns: Observable<User>

<Const> TOFALSE

TOFALSE(): Observable<boolean>
Defined in services/wch/wch.edit.service.ts:75
Returns: Observable<boolean>

<Const> getCurrentTenantUrl

getCurrentTenantUrl(aBase: string): string
Defined in services/wch/wch.edit.service.ts:90
Parameters:
| Name | Type | | ------ | ------ | | aBase | string |
Returns: string

<Const> getCurrentUserUrl

getCurrentUserUrl(aBase: string): string
Defined in services/wch/wch.edit.service.ts:89
Parameters:
| Name | Type | | ------ | ------ | | aBase | string |
Returns: string

<Const> isAuthenticated

isAuthenticated(aUser: User): boolean
Defined in services/wch/wch.edit.service.ts:94
Parameters:
| Name | Type | | ------ | ------ | | aUser | User |
Returns: boolean

Object literals

<Const> ANONYMOUSUSER

ANONYMOUSUSER: object
Defined in services/wch/wch.edit.service.ts:66

externalId

● externalId: string = "ibm
anonymoususer@de.ibm.com"
Defined in services/wch/wch.edit.service.ts:69

id

● id: string = "00000000-0000-f000-0000-000000000000"
Defined in services/wch/wch.edit.service.ts:67

roles

● roles: undefined
=
Defined in services/wch/wch.edit.service.ts:68

<Const> HTTPWITHCREDENTIALS

HTTPWITHCREDENTIALS: object
Defined in services/wch/wch.edit.service.ts:78

withCredentials

● withCredentials: true = true
Defined in services/wch/wch.edit.service.ts:78

<Const> JSONWITHOUTCREDENTIALS

JSONWITHOUTCREDENTIALS: object
Defined in services/wch/wch.edit.service.ts:83

responseType

● responseType: "json" = "json"
Defined in services/wch/wch.edit.service.ts:86

withCredentials

● withCredentials: false = false
Defined in services/wch/wch.edit.service.ts:86

<Const> JSONWITHCREDENTIALS

JSONWITHCREDENTIALS: object
Defined in services/wch/wch.edit.service.ts:79

responseType

● responseType: "json" = "json"
Defined in services/wch/wch.edit.service.ts:82

withCredentials

● withCredentials: true = true
Defined in services/wch/wch.edit.service.ts:82


@ibm-wch-sdk/ng-edit
> "utils/assert"
External module: "utils/assert"

Index

Functions


Functions

assert

assert<T>(aPredicate: function, aFailHandler: function): function
Defined in utils/assert.ts:3
Type parameters:

T

Parameters:
| Name | Type | | ------ | ------ | | aPredicate | function | | aFailHandler | function |
Returns: function

@ibm-wch-sdk/ng-edit
> "utils/config"
External module: "utils/config"

Index

Functions


Functions

loadWchConfig

loadWchConfig(aJsonp: WchHttpService): Observable<WchConfig>
Defined in utils/config.ts:16
Loads the WCH config
Parameters:
| Name | Type | Description | | ------ | ------ | ------ | | aJsonp | WchHttpService | the JSONp callback |
Returns: Observable<WchConfig> the resulting config object

@ibm-wch-sdk/ng-edit
> "utils/events"
External module: "utils/events"

Index

Functions


Functions

createWchEditableEvent

createWchEditableEvent(aType: string, aTarget: HTMLElement, aData: any): WchEditableEvent
Defined in utils/events.ts:18
Constructs the event
Parameters:
| Name | Type | Description | | ------ | ------ | ------ | | aType | string | the event type | | aTarget | HTMLElement | the target node | | aData | any | the event data |
Returns: WchEditableEvent the event object

registerForEvent

registerForEvent(aType: string, aTarget: HTMLElement, aEmitter: EventTargetLike<any>, aLogger: Logger): Observable<WchEditableEvent>
Defined in utils/events.ts:41
Registers for an event
Parameters:
| Name | Type | Description | | ------ | ------ | ------ | | aType | string | the event type | | aTarget | HTMLElement | the current element | | aEmitter | EventTargetLike<any> | the event emitter | | aLogger | Logger |
Returns: Observable<WchEditableEvent> the sequence of events

createWchEditableEvents

createWchEditableEvents(aTarget: HTMLElement, aEmitter: EventTargetLike<any>, aLogger: Logger): Observable<WchEditableEvent>
Defined in utils/events.ts:67
Construct the event stream
Parameters:
| Name | Type | Description | | ------ | ------ | ------ | | aTarget | HTMLElement | the target element | | aEmitter | EventTargetLike<any> | the event emitter | | aLogger | Logger |
Returns: Observable<WchEditableEvent> the event stream

@ibm-wch-sdk/ng-edit
> "utils/placeholder"
External module: "utils/placeholder"

Index

Type aliases

Variables

Functions


Type aliases

WchDefaultPlaceholder

Ƭ WchDefaultPlaceholder: ObservableOrT<string \| LocalizedText>
Defined in utils/placeholder.ts:43
type for placeholder

WchEditableFormat

Ƭ WchEditableFormat: "text" \| "html" \| "auto"
Defined in utils/placeholder.ts:50
Potential values for the 'wchFormat' field

Variables

<Const> UNDEFINED

● UNDEFINED: any = undefined
Defined in utils/placeholder.ts:56

<Const> WCHEDITABLEAUTOFORMAT

● WCHEDITABLEAUTOFORMAT: "auto" = "auto"
Defined in utils/placeholder.ts:53

<Const> WCHEDITABLEHTMLFORMAT

● WCHEDITABLEHTMLFORMAT: "html" = "html"
Defined in utils/placeholder.ts:54

<Const> WCHEDITABLETEXTFORMAT

● WCHEDITABLETEXTFORMAT: "text" = "text"
Defined in utils/placeholder.ts:52
<