Changeset - 4031e511bca9
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 20 months ago 2023-05-30 08:00:32
drewp@bigasterisk.com
resource-display uri can no longer be a string
2 files changed with 4 insertions and 5 deletions:
0 comments (0 inline, 0 general)
light9/web/EditChoice.ts
Show inline comments
 
@@ -52,25 +52,25 @@ function setupDrop(
 
    } catch (e) {
 
      log(e);
 
    }
 
    unhighlight();
 
  });
 
}
 

	
 
// Picks a URI based on the caller setting the property OR
 
// the user drag-and-dropping a text/uri-list resource (probably
 
// an <resource-display> or <a href> tag)
 
@customElement("edit-choice")
 
export class EditChoice extends LitElement {
 
  @property() uri: NamedNode | null = null;
 
  @property() uri?: NamedNode
 
  static styles = [
 
    css`
 
      :host {
 
        display: inline-block;
 
        background: #141448;
 
        min-width: 10em;
 
        padding: 3px 8px;
 
      }
 
      .dragging {
 
        background: rgba(126, 52, 245, 0.0784313725490196);
 
        box-shadow: 0 0 20px #ffff00;
 
      }
 
@@ -93,21 +93,21 @@ export class EditChoice extends LitEleme
 
    super();
 
    setupDrop(this, this, null, this._setUri.bind(this));
 
  }
 

	
 
  // updated(changedProperties: PropertyValues) {
 
  //   log('cp' ,changedProperties)
 
  //   if (changedProperties.has("box")) {
 
  //     log('setupdrop', this.box)
 
  //     setupDrop(this.box, this.box, null, this._setUri.bind(this));
 
  //   }
 
  // }
 

	
 
  _setUri(u: any) {
 
  _setUri(u?: NamedNode) {
 
    this.uri = u;
 
    this.dispatchEvent(new CustomEvent("edited", {detail: {newValue: u}}));
 
  }
 

	
 
  unlink() {
 
    return this._setUri(null);
 
    return this._setUri(undefined);
 
  }
 
}
light9/web/ResourceDisplay.ts
Show inline comments
 
@@ -63,26 +63,25 @@ export class ResourceDisplay extends Lit
 
    //     <p>
 
    //       New label:
 
    //       <input id="renameTo" autofocus type="text" value="{{renameTo::input}}" on-keydown="onRenameKey" />
 
    //     </p>
 
    //     <div class="buttons">
 
    //       <paper-button dialog-dismiss>Cancel</paper-button>
 
    //       <paper-button dialog-confirm>OK</paper-button>
 
    //     </div>
 
    //   </paper-dialog>
 
    // </template>
 
    //    `;
 
  }
 
  // callers might set this as string or pass a NamedNode.
 
  @property() uri?: NamedNode | string;
 
  @property() uri?: NamedNode;
 

	
 
  @state() label: string = "";
 
  
 
  @property({type: Boolean}) rename: boolean = false;
 
  @property({type: Boolean}) minor: boolean = false;
 
  // @state() renameTo: String; notify: true };
 

	
 
  constructor() {
 
    super();
 
    getTopGraph().then((g) => {
 
      this.graph = g;
 
      this.runUriHandler();
0 comments (0 inline, 0 general)